|
| 1 | +--- |
1 | 2 | name: release
|
2 | 3 |
|
3 | 4 | on:
|
|
6 | 7 | - published
|
7 | 8 | schedule:
|
8 | 9 | - cron: '45 5 * * *'
|
| 10 | + workflow_dispatch: |
9 | 11 |
|
10 | 12 | jobs:
|
11 | 13 | build:
|
12 | 14 | strategy:
|
13 | 15 | matrix:
|
14 | 16 | build_cmd:
|
15 |
| - - ./build-latest.sh |
16 |
| - - PRERELEASE=true ./build-latest.sh |
17 |
| - - ./build.sh feature |
18 |
| - - ./build.sh develop |
| 17 | + - ./build-latest.sh |
| 18 | + - PRERELEASE=true ./build-latest.sh |
| 19 | + - ./build.sh feature |
| 20 | + - ./build.sh develop |
| 21 | + platform: |
| 22 | + - linux/amd64,linux/arm64 |
19 | 23 | fail-fast: false
|
20 | 24 | runs-on: ubuntu-latest
|
21 | 25 | name: Builds new NetBox Docker Images
|
22 | 26 | env:
|
23 | 27 | GH_ACTION: enable
|
| 28 | + IMAGE_NAMES: docker.io/netboxcommunity/netbox quay.io/netboxcommunity/netbox ghcr.io/netbox-community/netbox |
24 | 29 | steps:
|
25 |
| - - |
26 |
| - name: Checkout |
27 |
| - uses: actions/checkout@v3 |
28 |
| - - |
29 |
| - name: Get Version of NetBox Docker |
30 |
| - run: | |
31 |
| - echo "::set-output name=version::$(cat VERSION)" |
32 |
| - shell: bash |
33 |
| - - |
34 |
| - id: docker-build |
35 |
| - name: Build the image with '${{ matrix.build_cmd }}' |
36 |
| - run: ${{ matrix.build_cmd }} |
37 |
| - - |
38 |
| - name: Test the image |
39 |
| - run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh |
40 |
| - if: steps.docker-build.outputs.skipped != 'true' |
41 |
| - |
42 |
| - # docker.io |
43 |
| - - |
44 |
| - name: Login to docker.io |
45 |
| - uses: docker/login-action@v2 |
46 |
| - with: |
47 |
| - registry: docker.io |
48 |
| - username: ${{ secrets.dockerhub_username }} |
49 |
| - password: ${{ secrets.dockerhub_password }} |
50 |
| - if: steps.docker-build.outputs.skipped != 'true' |
51 |
| - - |
52 |
| - name: Push the image to docker.io |
53 |
| - run: ${{ matrix.build_cmd }} --push-only |
54 |
| - if: steps.docker-build.outputs.skipped != 'true' |
55 |
| - |
56 |
| - # quay.io |
57 |
| - - |
58 |
| - name: Login to Quay.io |
59 |
| - uses: docker/login-action@v2 |
60 |
| - with: |
61 |
| - registry: quay.io |
62 |
| - username: ${{ secrets.quayio_username }} |
63 |
| - password: ${{ secrets.quayio_password }} |
64 |
| - if: steps.docker-build.outputs.skipped != 'true' |
65 |
| - - |
66 |
| - name: Build and push the image with '${{ matrix.build_cmd }}' |
67 |
| - run: ${{ matrix.build_cmd }} --push |
68 |
| - env: |
69 |
| - DOCKER_REGISTRY: quay.io |
70 |
| - if: steps.docker-build.outputs.skipped != 'true' |
71 |
| - |
72 |
| - # ghcr.io |
73 |
| - - |
74 |
| - name: Login to GitHub Container Registry |
75 |
| - uses: docker/login-action@v2 |
76 |
| - with: |
77 |
| - registry: ghcr.io |
78 |
| - username: ${{ github.repository_owner }} |
79 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
80 |
| - if: steps.docker-build.outputs.skipped != 'true' |
81 |
| - - |
82 |
| - name: Build and push the image with '${{ matrix.build_cmd }}' |
83 |
| - run: ${{ matrix.build_cmd }} --push |
84 |
| - env: |
85 |
| - DOCKER_REGISTRY: ghcr.io |
86 |
| - DOCKER_ORG: netbox-community |
87 |
| - if: steps.docker-build.outputs.skipped != 'true' |
| 30 | + - id: source-checkout |
| 31 | + name: Checkout |
| 32 | + uses: actions/checkout@v3 |
| 33 | + - id: set-netbox-docker-version |
| 34 | + name: Get Version of NetBox Docker |
| 35 | + run: echo "::set-output name=version::$(cat VERSION)" |
| 36 | + shell: bash |
| 37 | + - id: qemu-setup |
| 38 | + name: Set up QEMU |
| 39 | + uses: docker/setup-qemu-action@v1 |
| 40 | + - id: buildx-setup |
| 41 | + name: Set up Docker Buildx |
| 42 | + uses: docker/setup-buildx-action@v1 |
| 43 | + - id: docker-build |
| 44 | + name: Build the image with '${{ matrix.build_cmd }}' |
| 45 | + run: ${{ matrix.build_cmd }} |
| 46 | + - id: test-image |
| 47 | + name: Test the image |
| 48 | + run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh |
| 49 | + if: steps.docker-build.outputs.skipped != 'true' |
| 50 | + # docker.io |
| 51 | + - id: docker-io-login |
| 52 | + name: Login to docker.io |
| 53 | + uses: docker/login-action@v2 |
| 54 | + with: |
| 55 | + registry: docker.io |
| 56 | + username: ${{ secrets.dockerhub_username }} |
| 57 | + password: ${{ secrets.dockerhub_password }} |
| 58 | + if: steps.docker-build.outputs.skipped != 'true' |
| 59 | + # quay.io |
| 60 | + - id: quay-io-login |
| 61 | + name: Login to Quay.io |
| 62 | + uses: docker/login-action@v2 |
| 63 | + with: |
| 64 | + registry: quay.io |
| 65 | + username: ${{ secrets.quayio_username }} |
| 66 | + password: ${{ secrets.quayio_password }} |
| 67 | + if: steps.docker-build.outputs.skipped != 'true' |
| 68 | + # ghcr.io |
| 69 | + - id: ghcr-io-login |
| 70 | + name: Login to GitHub Container Registry |
| 71 | + uses: docker/login-action@v2 |
| 72 | + with: |
| 73 | + registry: ghcr.io |
| 74 | + username: ${{ github.repository_owner }} |
| 75 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + if: steps.docker-build.outputs.skipped != 'true' |
| 77 | + - id: build-and-push |
| 78 | + name: Push the image |
| 79 | + run: ${{ matrix.build_cmd }} --push |
| 80 | + if: steps.docker-build.outputs.skipped != 'true' |
| 81 | + env: |
| 82 | + BUILDX_PLATFORM: ${{ matrix.platform }} |
| 83 | + BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }} |
0 commit comments