2022-06-15 01:22:11 -05:00
|
|
|
---
|
2020-01-23 02:35:30 -06:00
|
|
|
name: release
|
|
|
|
|
2019-12-23 10:53:19 -06:00
|
|
|
on:
|
2021-10-18 04:42:59 -05:00
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
2019-12-23 10:53:19 -06:00
|
|
|
schedule:
|
|
|
|
- cron: '45 5 * * *'
|
2022-06-15 01:22:11 -05:00
|
|
|
workflow_dispatch:
|
2019-12-23 10:53:19 -06:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_cmd:
|
2022-06-15 01:22:11 -05:00
|
|
|
- ./build-latest.sh
|
|
|
|
- PRERELEASE=true ./build-latest.sh
|
|
|
|
- ./build.sh feature
|
|
|
|
- ./build.sh develop
|
|
|
|
platform:
|
|
|
|
- linux/amd64,linux/arm64
|
2019-12-23 10:53:19 -06:00
|
|
|
fail-fast: false
|
|
|
|
runs-on: ubuntu-latest
|
2021-02-04 14:48:08 -06:00
|
|
|
name: Builds new NetBox Docker Images
|
2021-12-09 03:31:09 -06:00
|
|
|
env:
|
|
|
|
GH_ACTION: enable
|
2023-01-28 05:00:40 -06:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-06-15 01:22:11 -05:00
|
|
|
IMAGE_NAMES: docker.io/netboxcommunity/netbox quay.io/netboxcommunity/netbox ghcr.io/netbox-community/netbox
|
2019-12-23 10:53:19 -06:00
|
|
|
steps:
|
2022-06-15 01:22:11 -05:00
|
|
|
- id: source-checkout
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- id: set-netbox-docker-version
|
|
|
|
name: Get Version of NetBox Docker
|
2023-01-28 08:42:32 -06:00
|
|
|
run: echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
|
2022-06-15 01:22:11 -05:00
|
|
|
shell: bash
|
|
|
|
- id: qemu-setup
|
|
|
|
name: Set up QEMU
|
2022-07-15 13:36:01 -05:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-06-15 01:22:11 -05:00
|
|
|
- id: buildx-setup
|
|
|
|
name: Set up Docker Buildx
|
2022-07-16 03:23:01 -05:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-06-15 01:22:11 -05:00
|
|
|
- id: docker-build
|
|
|
|
name: Build the image with '${{ matrix.build_cmd }}'
|
|
|
|
run: ${{ matrix.build_cmd }}
|
|
|
|
- id: test-image
|
|
|
|
name: Test the image
|
|
|
|
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
# docker.io
|
|
|
|
- id: docker-io-login
|
|
|
|
name: Login to docker.io
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: docker.io
|
|
|
|
username: ${{ secrets.dockerhub_username }}
|
|
|
|
password: ${{ secrets.dockerhub_password }}
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
# quay.io
|
|
|
|
- id: quay-io-login
|
|
|
|
name: Login to Quay.io
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: quay.io
|
|
|
|
username: ${{ secrets.quayio_username }}
|
|
|
|
password: ${{ secrets.quayio_password }}
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
# ghcr.io
|
|
|
|
- id: ghcr-io-login
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
- id: build-and-push
|
|
|
|
name: Push the image
|
|
|
|
run: ${{ matrix.build_cmd }} --push
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
env:
|
|
|
|
BUILDX_PLATFORM: ${{ matrix.platform }}
|
|
|
|
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}
|