netbox-docker/.github/workflows/release.yml

85 lines
2.6 KiB
YAML
Raw Permalink Normal View History

2022-06-15 01:22:11 -05:00
---
2020-01-23 02:35:30 -06:00
name: release
on:
2021-10-18 04:42:59 -05:00
release:
types:
- published
schedule:
- cron: '45 5 * * *'
2022-06-15 01:22:11 -05:00
workflow_dispatch:
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
fail-fast: false
runs-on: ubuntu-latest
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
steps:
2022-06-15 01:22:11 -05:00
- id: source-checkout
name: Checkout
2023-09-05 00:38:37 -05:00
uses: actions/checkout@v4
2022-06-15 01:22:11 -05:00
- 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
uses: docker/setup-qemu-action@v3
2022-06-15 01:22:11 -05:00
- id: buildx-setup
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
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@v3
2022-06-15 01:22:11 -05:00
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@v3
2022-06-15 01:22:11 -05:00
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@v3
2022-06-15 01:22:11 -05:00
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 }}