Explorar el Código

Build arm64 container images (#1855)

* Build container image on aarch64 platform

* Revert test code & correct typo

Co-authored-by: erin <erin@localhost>
tags/v2.9.0-rc1
erin hace 2 años
padre
commit
5c7f8faf0c
No account linked to committer's email address
Se han modificado 1 ficheros con 22 adiciones y 10 borrados
  1. 22
    10
      .github/workflows/docker-image.yml

+ 22
- 10
.github/workflows/docker-image.yml Ver fichero

8
     tags:
8
     tags:
9
       - 'v*'
9
       - 'v*'
10
 
10
 
11
+env:
12
+  REGISTRY: ghcr.io
13
+  IMAGE_NAME: ${{ github.repository }}
14
+
11
 jobs:
15
 jobs:
12
   build:
16
   build:
13
-    name: 'Build'
17
+    name: Build
14
     runs-on: ubuntu-latest
18
     runs-on: ubuntu-latest
15
     steps:
19
     steps:
16
-      - name: "Build:checkout"
20
+      - name: Checkout Git repository
17
         uses: actions/checkout@v2
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
         uses: docker/login-action@v1
24
         uses: docker/login-action@v1
25
         if: github.event_name != 'pull_request'
25
         if: github.event_name != 'pull_request'
26
         with:
26
         with:
27
-          registry: ghcr.io
27
+          registry: ${{ env.REGISTRY }}
28
           username: ${{ github.repository_owner }}
28
           username: ${{ github.repository_owner }}
29
           password: ${{ secrets.GITHUB_TOKEN }}
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
         uses: docker/build-push-action@v2
42
         uses: docker/build-push-action@v2
32
         with:
43
         with:
33
           context: .
44
           context: .
34
           push: ${{ github.event_name != 'pull_request' }}
45
           push: ${{ github.event_name != 'pull_request' }}
46
+          platforms: linux/amd64,linux/arm64
35
           tags: ${{ steps.meta.outputs.tags }}
47
           tags: ${{ steps.meta.outputs.tags }}
36
           labels: ${{ steps.meta.outputs.labels }}
48
           labels: ${{ steps.meta.outputs.labels }}

Loading…
Cancelar
Guardar