19
19
- ./build.sh feature
20
20
- ./build.sh develop
21
21
platform :
22
- - linux/amd64
22
+ - linux/amd64,linux/arm64
23
23
fail-fast : false
24
24
runs-on : ubuntu-latest
25
25
name : Builds new NetBox Docker Images
@@ -35,19 +35,11 @@ jobs:
35
35
name : Get Version of NetBox Docker
36
36
run : echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
37
37
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"
46
42
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'
51
43
# docker.io
52
44
- id : docker-io-login
53
45
name : Login to docker.io
56
48
registry : docker.io
57
49
username : ${{ secrets.dockerhub_username }}
58
50
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"
60
59
# quay.io
61
60
- id : quay-io-login
62
61
name : Login to Quay.io
65
64
registry : quay.io
66
65
username : ${{ secrets.quayio_username }}
67
66
password : ${{ secrets.quayio_password }}
68
- if : steps.docker -build.outputs.skipped != 'true'
67
+ if : steps.check -build-needed .outputs.skipped != 'true'
69
68
# ghcr.io
70
69
- id : ghcr-io-login
71
70
name : Login to GitHub Container Registry
@@ -74,11 +73,11 @@ jobs:
74
73
registry : ghcr.io
75
74
username : ${{ github.repository_owner }}
76
75
password : ${{ secrets.GITHUB_TOKEN }}
77
- if : steps.docker -build.outputs.skipped != 'true'
76
+ if : steps.check -build-needed .outputs.skipped != 'true'
78
77
- id : build-and-push
79
78
name : Push the image
80
79
run : ${{ matrix.build_cmd }} --push
81
- if : steps.docker -build.outputs.skipped != 'true'
80
+ if : steps.check -build-needed .outputs.skipped != 'true'
82
81
env :
83
82
BUILDX_PLATFORM : ${{ matrix.platform }}
84
83
BUILDX_BUILDER_NAME : ${{ steps.buildx-setup.outputs.name }}
0 commit comments