Skip to content

release

release #142

Workflow file for this run

---
name: release
on:
release:
types:
- published
schedule:
- cron: '45 5 * * 1,3,5'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
build_cmd:
- ./build-latest.sh
- ./build.sh develop
platform:
- linux/amd64,linux/arm64
fail-fast: false
runs-on: ubuntu-latest
name: Builds new NetBox Docker Images
env:
GH_ACTION: enable
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAMES: ghcr.io/oxcert/netbox
steps:
- id: source-checkout
name: Checkout
uses: actions/checkout@v4
- id: set-netbox-docker-version
name: Get Version of NetBox Docker
run: echo "version=$(cat VERSION)" >>"$GITHUB_OUTPUT"
shell: bash
- id: qemu-setup
name: Set up QEMU
uses: docker/setup-qemu-action@v3
- id: buildx-setup
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- 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'
# ghcr.io
- id: ghcr-io-login
name: Login to GitHub Container Registry
uses: docker/login-action@v3
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 }}