@@ -18,22 +18,46 @@ jobs:
18
18
username : ${{ secrets.DOCKERHUB_USERNAME }}
19
19
password : ${{ secrets.DOCKERHUB_TOKEN }}
20
20
21
- - name : Set up Docker Buildx
21
+ - name : Set up Docker Buildx (cloud driver)
22
22
uses : docker/setup-buildx-action@v3
23
23
with :
24
- version : " lab:latest"
24
+ version : lab:latest
25
25
driver : cloud
26
- endpoint : " fontebasso/multiarch-builder"
26
+ endpoint : fontebasso/multiarch-builder
27
27
28
28
- name : Extract release version
29
29
id : version
30
30
run : echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
31
31
32
- - name : Build and push
32
+ - name : Build for amd64
33
33
uses : docker/build-push-action@v6
34
34
with :
35
35
context : .
36
36
tags : |
37
- fontebasso/php-nginx:${{ env.RELEASE_VERSION }}
38
- fontebasso/php-nginx:latest
39
- platforms : linux/amd64,linux/arm64
37
+ fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-amd64
38
+ platforms : linux/amd64
39
+ push : true
40
+
41
+ - name : Build for arm64
42
+ uses : docker/build-push-action@v6
43
+ with :
44
+ context : .
45
+ tags : |
46
+ fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-arm64
47
+ platforms : linux/arm64
48
+ push : true
49
+
50
+ - name : Merge and push multi-arch
51
+ run : |
52
+ docker buildx imagetools create \
53
+ --tag fontebasso/php-nginx:${{ env.RELEASE_VERSION }} \
54
+ --tag fontebasso/php-nginx:latest \
55
+ fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-amd64 \
56
+ fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-arm64
57
+
58
+ - name : Clean up intermediate tags
59
+ run : |
60
+ docker logout
61
+ echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
62
+ docker rmi fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-amd64 || true
63
+ docker rmi fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-arm64 || true
0 commit comments