@@ -35,19 +35,11 @@ jobs:
3535 name : Get Version of NetBox Docker
3636 run : echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
3737 shell : bash
38- - id : qemu-setup
39- name : Set up QEMU
40- uses : docker/setup-qemu-action@v3
41- - id : buildx-setup
42- name : Set up Docker Buildx
43- uses : docker/setup-buildx-action@v3
44- - id : docker-build
45- name : Build the image with '${{ matrix.build_cmd }}'
38+ - id : check-build-needed
39+ name : Check if the build is needed for '${{ matrix.build_cmd }}'
40+ env :
41+ CHECK_ONLY : " true"
4642 run : ${{ matrix.build_cmd }}
47- - id : test-image
48- name : Test the image
49- run : IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
50- if : steps.docker-build.outputs.skipped != 'true'
5143 # docker.io
5244 - id : docker-io-login
5345 name : Login to docker.io
5648 registry : docker.io
5749 username : ${{ secrets.dockerhub_username }}
5850 password : ${{ secrets.dockerhub_password }}
59- if : steps.docker-build.outputs.skipped != 'true'
51+ if : steps.check-build-needed.outputs.skipped != 'true'
52+ - id : buildx-setup
53+ name : Set up Docker Buildx
54+ uses : docker/setup-buildx-action@v3
55+ with :
56+ version : " lab:latest"
57+ driver : cloud
58+ endpoint : " netboxcommunity/netbox-default"
6059 # quay.io
6160 - id : quay-io-login
6261 name : Login to Quay.io
6564 registry : quay.io
6665 username : ${{ secrets.quayio_username }}
6766 password : ${{ secrets.quayio_password }}
68- if : steps.docker -build.outputs.skipped != 'true'
67+ if : steps.check -build-needed .outputs.skipped != 'true'
6968 # ghcr.io
7069 - id : ghcr-io-login
7170 name : Login to GitHub Container Registry
@@ -74,11 +73,11 @@ jobs:
7473 registry : ghcr.io
7574 username : ${{ github.repository_owner }}
7675 password : ${{ secrets.GITHUB_TOKEN }}
77- if : steps.docker -build.outputs.skipped != 'true'
76+ if : steps.check -build-needed .outputs.skipped != 'true'
7877 - id : build-and-push
7978 name : Push the image
8079 run : ${{ matrix.build_cmd }} --push
81- if : steps.docker -build.outputs.skipped != 'true'
80+ if : steps.check -build-needed .outputs.skipped != 'true'
8281 env :
8382 BUILDX_PLATFORM : ${{ matrix.platform }}
8483 BUILDX_BUILDER_NAME : ${{ steps.buildx-setup.outputs.name }}
0 commit comments