1
1
name : release
2
2
3
3
on :
4
- push :
5
- branches :
6
- - release
4
+ release :
5
+ types :
6
+ - published
7
7
schedule :
8
8
- cron : ' 45 5 * * *'
9
9
@@ -20,64 +20,82 @@ jobs:
20
20
runs-on : ubuntu-latest
21
21
name : Builds new NetBox Docker Images
22
22
steps :
23
- - id : git-checkout
23
+ -
24
24
name : Checkout
25
25
uses : actions/checkout@v2
26
- - id : docker-build
26
+ -
27
+ name : Get Version of NetBox Docker
28
+ run : |
29
+ echo "::set-output name=version::$(cat VERSION)"
30
+ shell : bash
31
+ -
32
+ name : Set up QEMU
33
+ uses : docker/setup-qemu-action@v1
34
+ -
35
+ id : buildx-setup
36
+ name : Set up Docker Buildx
37
+ uses : docker/setup-buildx-action@v1
38
+ with :
39
+ install : true
40
+ -
41
+ name : Available platforms
42
+ run : echo ${{ steps.buildx-setup.outputs.platforms }}
43
+ -
44
+ id : docker-build
27
45
name : Build the image with '${{ matrix.build_cmd }}'
28
46
run : ${{ matrix.build_cmd }}
29
47
env :
30
48
GH_ACTION : enable
31
- - id : docker-test
49
+ -
32
50
name : Test the image
33
51
run : IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
34
52
if : steps.docker-build.outputs.skipped != 'true'
35
- - id : registry-login
36
- name : Login to the Docker Registry
37
- run : |
38
- echo "::add-mask::$DOCKERHUB_USERNAME"
39
- echo "::add-mask::$DOCKERHUB_PASSWORD"
40
- docker login -u "$DOCKERHUB_USERNAME" --password "${DOCKERHUB_PASSWORD}" "${DOCKER_REGISTRY}"
41
- env :
42
- DOCKERHUB_USERNAME : ${{ secrets.dockerhub_username }}
43
- DOCKERHUB_PASSWORD : ${{ secrets.dockerhub_password }}
53
+
54
+ # docker.io
55
+ -
56
+ name : Login to docker.io
57
+ uses : docker/login-action@v1
58
+ with :
59
+ registry : docker.io
60
+ username : ${{ secrets.dockerhub_username }}
61
+ password : ${{ secrets.dockerhub_password }}
44
62
if : steps.docker-build.outputs.skipped != 'true'
45
- - id : registry-push
46
- name : Push the image
63
+ -
64
+ name : Push the image to docker.io
47
65
run : ${{ matrix.build_cmd }} --push-only
48
66
if : steps.docker-build.outputs.skipped != 'true'
49
- - id : registry-logout
50
- name : Logout of the Docker Registry
51
- run : docker logout "${DOCKER_REGISTRY}"
52
- if : steps.docker-build.outputs.skipped != 'true'
53
67
54
- # Quay.io
55
- - id : quayio-docker-build
56
- name : Build the image with '${{ matrix.build_cmd }}'
57
- run : ${{ matrix.build_cmd }}
68
+ # quay.io
69
+ -
70
+ name : Login to Quay.io
71
+ uses : docker/login-action@v1
72
+ with :
73
+ registry : quay.io
74
+ username : ${{ secrets.quayio_username }}
75
+ password : ${{ secrets.quayio_password }}
76
+ if : steps.docker-build.outputs.skipped != 'true'
77
+ -
78
+ name : Build and push the image with '${{ matrix.build_cmd }}'
79
+ run : ${{ matrix.build_cmd }} --push
58
80
env :
59
81
DOCKER_REGISTRY : quay.io
60
82
GH_ACTION : enable
61
- - id : quayio-registry-login
62
- name : Login to the Quay.io Registry
63
- run : |
64
- echo "::add-mask::$QUAYIO_USERNAME"
65
- echo "::add-mask::$QUAYIO_PASSWORD"
66
- docker login -u "$QUAYIO_USERNAME" --password "${QUAYIO_PASSWORD}" "${DOCKER_REGISTRY}"
67
- env :
68
- DOCKER_REGISTRY : quay.io
69
- QUAYIO_USERNAME : ${{ secrets.quayio_username }}
70
- QUAYIO_PASSWORD : ${{ secrets.quayio_password }}
71
83
if : steps.docker-build.outputs.skipped != 'true'
72
- - id : quayio-registry-push
73
- name : Push the image
74
- run : ${{ matrix.build_cmd }} --push-only
75
- env :
76
- DOCKER_REGISTRY : quay.io
84
+
85
+ # ghcr.io
86
+ -
87
+ name : Login to GitHub Container Registry
88
+ uses : docker/login-action@v1
89
+ with :
90
+ registry : ghcr.io
91
+ username : ${{ github.repository_owner }}
92
+ password : ${{ secrets.GITHUB_TOKEN }}
77
93
if : steps.docker-build.outputs.skipped != 'true'
78
- - id : quayio-registry-logout
79
- name : Logout of the Docker Registry
80
- run : docker logout "${DOCKER_REGISTRY}"
94
+ -
95
+ name : Build and push the image with '${{ matrix.build_cmd }}'
96
+ run : ${{ matrix.build_cmd }} --push
81
97
env :
82
- DOCKER_REGISTRY : quay.io
98
+ DOCKER_REGISTRY : ghcr.io
99
+ DOCKER_ORG : netbox-community
100
+ GH_ACTION : enable
83
101
if : steps.docker-build.outputs.skipped != 'true'
0 commit comments