2022-06-15 08:22:11 +02:00
|
|
|
---
|
2020-01-23 09:35:30 +01:00
|
|
|
name: release
|
|
|
|
|
2019-12-23 17:53:19 +01:00
|
|
|
on:
|
2021-10-18 11:42:59 +02:00
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
2019-12-23 17:53:19 +01:00
|
|
|
schedule:
|
|
|
|
- cron: '45 5 * * *'
|
2022-06-15 08:22:11 +02:00
|
|
|
workflow_dispatch:
|
2019-12-23 17:53:19 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_cmd:
|
2022-06-15 08:22:11 +02:00
|
|
|
- ./build-latest.sh
|
|
|
|
- PRERELEASE=true ./build-latest.sh
|
|
|
|
- ./build.sh feature
|
|
|
|
- ./build.sh develop
|
|
|
|
platform:
|
|
|
|
- linux/amd64,linux/arm64
|
2019-12-23 17:53:19 +01:00
|
|
|
fail-fast: false
|
|
|
|
runs-on: ubuntu-latest
|
2021-02-04 21:48:08 +01:00
|
|
|
name: Builds new NetBox Docker Images
|
2021-12-09 10:31:09 +01:00
|
|
|
env:
|
|
|
|
GH_ACTION: enable
|
2023-01-28 12:00:40 +01:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-06-15 08:22:11 +02:00
|
|
|
IMAGE_NAMES: docker.io/netboxcommunity/netbox quay.io/netboxcommunity/netbox ghcr.io/netbox-community/netbox
|
2019-12-23 17:53:19 +01:00
|
|
|
steps:
|
2022-06-15 08:22:11 +02:00
|
|
|
- id: source-checkout
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- id: set-netbox-docker-version
|
|
|
|
name: Get Version of NetBox Docker
|
2023-01-28 15:42:32 +01:00
|
|
|
run: echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
|
2022-06-15 08:22:11 +02:00
|
|
|
shell: bash
|
|
|
|
- id: qemu-setup
|
|
|
|
name: Set up QEMU
|
2022-07-15 20:36:01 +02:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-06-15 08:22:11 +02:00
|
|
|
- id: buildx-setup
|
|
|
|
name: Set up Docker Buildx
|
2022-07-16 10:23:01 +02:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-06-15 08:22:11 +02: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 }}
|