@@ -43,25 +43,38 @@ jobs:
4343 key : ${{ runner.os }}-buildx-${{ github.sha }}
4444 restore-keys : |
4545 ${{ runner.os }}-buildx-
46- - name : Build and push Docker image
46+ - name : Build Docker image for amd64
4747 uses : docker/build-push-action@v5
4848 with :
49- platforms : linux/amd64,linux/arm64
49+ platforms : linux/amd64
5050 push : false
5151 tags : |
52- cybuerg/cfspeedtest:${{ github.sha }}
52+ cybuerg/cfspeedtest:${{ github.sha }}-amd64
5353 cache-from : type=local,src=/tmp/.buildx-cache
5454 cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
55- outputs : type=docker,dest=/tmp/docker-image.tar
55+ outputs : type=docker,dest=/tmp/docker-image-amd64.tar
56+
57+ - name : Build Docker image for arm64
58+ uses : docker/build-push-action@v5
59+ with :
60+ platforms : linux/arm64
61+ push : false
62+ tags : |
63+ cybuerg/cfspeedtest:${{ github.sha }}-arm64
64+ cache-from : type=local,src=/tmp/.buildx-cache
65+ cache-to : type=local,dest=/tmp/.buildx-cache-new,mode=max
66+ outputs : type=docker,dest=/tmp/docker-image-arm64.tar
5667 - name : Move cache
5768 run : |
5869 rm -rf /tmp/.buildx-cache
5970 mv /tmp/.buildx-cache-new /tmp/.buildx-cache
60- - name : Upload Docker image as artifact
71+ - name : Upload Docker images as artifacts
6172 uses : actions/upload-artifact@v4
6273 with :
63- name : docker-image
64- path : /tmp/docker-image.tar
74+ name : docker-images
75+ path : |
76+ /tmp/docker-image-amd64.tar
77+ /tmp/docker-image-arm64.tar
6578 retention-days : 1
6679
6780 verify-docker-image :
@@ -71,21 +84,25 @@ jobs:
7184 matrix :
7285 platform : [linux/amd64, linux/arm64]
7386 steps :
74- - name : Download Docker image
87+ - name : Download Docker images
7588 uses : actions/download-artifact@v4
7689 with :
77- name : docker-image
90+ name : docker-images
7891 path : /tmp
7992 - name : Load Docker image
8093 run : |
81- docker load < /tmp/docker-image.tar
94+ if [ "${{ matrix.platform }}" = "linux/amd64" ]; then
95+ docker load < /tmp/docker-image-amd64.tar
96+ else
97+ docker load < /tmp/docker-image-arm64.tar
98+ fi
8299 - name : Verify amd64 image
83100 if : matrix.platform == 'linux/amd64'
84101 run : |
85- docker run --platform linux/amd64 cybuerg/cfspeedtest:${{ github.sha }} --help
86- docker run --platform linux/amd64 -- entrypoint /bin/sh cybuerg/cfspeedtest:${{ github.sha }} -c "file /usr/local/bin/cfspeedtest" | grep "x86-64"
102+ docker run cybuerg/cfspeedtest:${{ github.sha }}-amd64 --help
103+ docker run --entrypoint /bin/sh cybuerg/cfspeedtest:${{ github.sha }}-amd64 -c "file /usr/local/bin/cfspeedtest" | grep "x86-64"
87104 - name : Verify arm64 image
88105 if : matrix.platform == 'linux/arm64'
89106 run : |
90- docker run --platform linux/arm64 cybuerg/cfspeedtest:${{ github.sha }} --help
91- docker run --platform linux/arm64 -- entrypoint /bin/sh cybuerg/cfspeedtest:${{ github.sha }} -c "file /usr/local/bin/cfspeedtest" | grep "aarch64"
107+ docker run cybuerg/cfspeedtest:${{ github.sha }}-arm64 --help
108+ docker run --entrypoint /bin/sh cybuerg/cfspeedtest:${{ github.sha }}-arm64 -c "file /usr/local/bin/cfspeedtest" | grep "aarch64"
0 commit comments