-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (56 loc) · 1.85 KB
/
Copy pathbuild-push.yml
File metadata and controls
65 lines (56 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: build-image
on:
push:
tags:
- '*'
- '**'
release:
types: [ published ]
workflow_dispatch:
env:
REGISTRY_FQDN: ghcr.io
REGISTRY_USERNAME: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
SERVER_IMAGE_NAME: knaw-huc/annorepo-server
SERVER_IMAGE_FILE: k8s/annorepo-server/Dockerfile-multistage
UPDATER_IMAGE_NAME: knaw-huc/annorepo-updater
UPDATER_IMAGE_FILE: k8s/updater/Dockerfile
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY_FQDN }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker (server)
id: meta
uses: docker/metadata-action@v4.1.1
with:
images: ${{ env.REGISTRY_FQDN }}/${{ env.SERVER_IMAGE_NAME }}
- name: Build and push Docker image (server)
uses: docker/build-push-action@v3.2.0
with:
file: ${{ env.SERVER_IMAGE_FILE }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
push: true
- name: Extract metadata (tags, labels) for Docker (updater)
id: meta-updater
uses: docker/metadata-action@v4.1.1
with:
images: ${{ env.REGISTRY_FQDN }}/${{ env.UPDATER_IMAGE_NAME }}
- name: Build and push Docker image (updater)
uses: docker/build-push-action@v3.2.0
with:
file: ${{ env.UPDATER_IMAGE_FILE }}
labels: ${{ steps.meta-updater.outputs.labels }}
tags: ${{ steps.meta-updater.outputs.tags }}
push: true