44 workflow_dispatch :
55 workflow_run :
66 workflows : ["Playwright Tests"]
7- types :
8- - completed
7+ types : [completed]
98 branches : [development, production]
109
1110env :
@@ -33,83 +32,38 @@ jobs:
3332 - name : Convert image name
3433 id : step1
3534 run : |
36- echo "Current image name:"
37- echo $UPPER_IMAGE_NAME
3835 echo "IMAGE_NAME=$(echo $UPPER_IMAGE_NAME | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
39- echo "Converted image name:"
40- echo $(echo $UPPER_IMAGE_NAME | tr '[:upper:]' '[:lower:]')
41- echo "Step output:"
42- echo $GITHUB_OUTPUT
4336
44- build :
45- runs-on : ubuntu-latest
46- needs : prepare
47- strategy :
48- matrix :
49- platform :
50- - linux/amd64
51- - linux/arm64
52- env :
53- IMAGE_NAME : ${{ needs.prepare.outputs.image-name }}
54- permissions :
55- contents : read
56- packages : write
57- steps :
58- - name : Prepare
59- run : |
60- platform=${{ matrix.platform }}
61- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
62-
63- - name : Checkout repository
64- uses : actions/checkout@v4
65-
66- - name : Log in to the Container registry
67- uses : docker/login-action@v3
68- with :
69- registry : ${{ env.REGISTRY }}
70- username : ${{ github.actor }}
71- password : ${{ secrets.GITHUB_TOKEN }}
37+ # Dispatch builds
7238
73- - name : Extract metadata (tags, labels) for Docker
74- id : meta
75- uses : docker/metadata-action@v5
76- with :
77- images : ${{ env.IMAGE_NAME }}
78-
79- - name : Set up QEMU
80- uses : docker/setup-qemu-action@v3
81-
82- - name : Set up Docker Buildx
83- uses : docker/setup-buildx-action@v3
84-
85- - name : Build and push by digest
86- id : build
87- uses : docker/build-push-action@v6
88- with :
89- context : .
90- platforms : ${{ matrix.platform }}
91- labels : ${{ steps.meta.outputs.labels }}
92- outputs : type=image,"name=${{ env.IMAGE_NAME }}",push-by-digest=true,name-canonical=true,push=true
93-
94- - name : Export digest
95- run : |
96- mkdir -p ${{ runner.temp }}/digests
97- digest="${{ steps.build.outputs.digest }}"
98- touch "${{ runner.temp }}/digests/${digest#sha256:}"
39+ build-amd64 :
40+ name : Build AMD64 Image
41+ uses : ./.github/workflows/build-docker.yml
42+ needs : prepare
43+ with :
44+ platform-runner : ubuntu-latest
45+ platform-name : linux/amd64
46+ image-name : ${{ needs.prepare.outputs.image-name }}
47+ secrets : inherit
48+
49+ build-arm64 :
50+ name : Build ARM64 Image
51+ uses : ./.github/workflows/build-docker.yml
52+ needs : prepare
53+ with :
54+ platform-runner : ubuntu-24.04-arm
55+ platform-name : linux/arm64
56+ image-name : ${{ needs.prepare.outputs.image-name }}
57+ secrets : inherit
9958
100- - name : Upload digest
101- uses : actions/upload-artifact@v4
102- with :
103- name : digests-${{ env.PLATFORM_PAIR }}
104- path : ${{ runner.temp }}/digests/*
105- if-no-files-found : error
106- retention-days : 7
59+ # Merge and publish multi-arch image
10760
10861 merge :
10962 runs-on : ubuntu-latest
11063 needs :
11164 - prepare
112- - build
65+ - build-amd64
66+ - build-arm64
11367 env :
11468 IMAGE_NAME : ${{ needs.prepare.outputs.image-name }}
11569 BUILDX_NO_DEFAULT_ATTESTATIONS : 1
@@ -140,17 +94,11 @@ jobs:
14094 with :
14195 images : ${{ env.IMAGE_NAME }}
14296 tags : |
143- # for example: develop
14497 type=ref,event=branch
145- # for example: pr-35
14698 type=ref,event=pr
147- # for example: 2.3.4
14899 type=semver,pattern={{version}}
149- # for example: 2.3
150100 type=semver,pattern={{major}}.{{minor}}
151- # for example: 2
152101 type=semver,pattern={{major}}
153- # set 'latest' for new tags
154102 type=raw,value=latest,enable=${{ startsWith( github.ref, 'refs/tags/' ) }}
155103
156104 - name : Create manifest list and push
@@ -160,4 +108,4 @@ jobs:
160108 $(printf '${{ env.IMAGE_NAME }}@sha256:%s ' *)
161109
162110 - name : Inspect image
163- run : docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
111+ run : docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
0 commit comments