88 description : ' The name of the artifact to upload'
99 required : true
1010 type : string
11+ platform :
12+ description : ' The platform to build the image for'
13+ required : true
14+ type : string
1115
1216permissions :
1317 contents : read
2327 - name : Checkout
2428 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2529 - name : Set up QEMU for cross-platform builds
30+ # Only set up QEMU if the platform is not linux/amd64
31+ if : ${{ inputs.platform != 'linux/amd64' }}
2632 uses : docker/setup-qemu-action@4574d27a4764455b42196d70a065bc6853246a25 # v3
2733 - name : Set up Docker Buildx
2834 uses : docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3
@@ -45,27 +51,31 @@ jobs:
4551 run : |
4652 git lfs install
4753 git lfs pull
48- - name : Test build on arm64 and amd64
54+ - name : Test build - ${{ inputs.platform }}
4955 id : docker_build
5056 uses : docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v5
5157 with :
5258 context : .
5359 file : ./Dockerfile
54- platforms : linux/amd64,linux/arm64
60+ platforms : ${{ inputs.platform }}
5561 push : false # Only attempt to build, to verify the Dockerfile is working
56- # load: true
62+ load : true
5763 cache-from : type=gha
5864 cache-to : type=gha,mode=max
5965 build-args : |
6066 LATEST_RELEASE=${{ env.LATEST_RELEASE }}
6167 tags : ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
6268 - name : Save Docker image as a tarball
69+ # Only save the image if the build was for linux/amd64, as we only need it for the integration tests
70+ if : ${{ inputs.platform == 'linux/amd64' }}
6371 run : |
6472 # List all images
6573 docker images
6674 # Save the image as a tarball
6775 docker save -o image.tar ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
6876 - name : Upload Docker image artifact
77+ # Only upload the image if the build was for linux/amd64, as we only need it for the integration tests
78+ if : ${{ inputs.platform == 'linux/amd64' }}
6979 uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
7080 with :
7181 name : ${{ inputs.artifact-name }}
0 commit comments