|
@@ -8,29 +8,41 @@ on:
|
8
|
8
|
tags:
|
9
|
9
|
- 'v*'
|
10
|
10
|
|
|
11
|
+env:
|
|
12
|
+ REGISTRY: ghcr.io
|
|
13
|
+ IMAGE_NAME: ${{ github.repository }}
|
|
14
|
+
|
11
|
15
|
jobs:
|
12
|
16
|
build:
|
13
|
|
- name: 'Build'
|
|
17
|
+ name: Build
|
14
|
18
|
runs-on: ubuntu-latest
|
15
|
19
|
steps:
|
16
|
|
- - name: "Build:checkout"
|
|
20
|
+ - name: Checkout Git repository
|
17
|
21
|
uses: actions/checkout@v2
|
18
|
|
- - name: "Build:meta"
|
19
|
|
- id: meta
|
20
|
|
- uses: docker/metadata-action@v3
|
21
|
|
- with:
|
22
|
|
- images: ghcr.io/ergochat/ergo
|
23
|
|
- - name: "Build:login"
|
|
22
|
+
|
|
23
|
+ - name: Authenticate to container registry
|
24
|
24
|
uses: docker/login-action@v1
|
25
|
25
|
if: github.event_name != 'pull_request'
|
26
|
26
|
with:
|
27
|
|
- registry: ghcr.io
|
|
27
|
+ registry: ${{ env.REGISTRY }}
|
28
|
28
|
username: ${{ github.repository_owner }}
|
29
|
29
|
password: ${{ secrets.GITHUB_TOKEN }}
|
30
|
|
- - name: 'Build:dockerimage'
|
|
30
|
+
|
|
31
|
+ - name: Extract metadata
|
|
32
|
+ id: meta
|
|
33
|
+ uses: docker/metadata-action@v3
|
|
34
|
+ with:
|
|
35
|
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
36
|
+
|
|
37
|
+ - name: Setup Docker buildx driver
|
|
38
|
+ id: buildx
|
|
39
|
+ uses: docker/setup-buildx-action@v1
|
|
40
|
+
|
|
41
|
+ - name: Build and publish image
|
31
|
42
|
uses: docker/build-push-action@v2
|
32
|
43
|
with:
|
33
|
44
|
context: .
|
34
|
45
|
push: ${{ github.event_name != 'pull_request' }}
|
|
46
|
+ platforms: linux/amd64,linux/arm64
|
35
|
47
|
tags: ${{ steps.meta.outputs.tags }}
|
36
|
48
|
labels: ${{ steps.meta.outputs.labels }}
|