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 * * *'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_cmd:
|
|
|
|
- ./build-latest.sh
|
|
|
|
- PRERELEASE=true ./build-latest.sh
|
2021-04-24 10:58:15 +02:00
|
|
|
- ./build.sh feature
|
2020-04-08 21:38:50 +02:00
|
|
|
- ./build.sh develop
|
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
|
2019-12-23 17:53:19 +01:00
|
|
|
steps:
|
2021-10-18 11:42:59 +02:00
|
|
|
-
|
2020-01-17 18:10:36 +01:00
|
|
|
name: Checkout
|
2020-04-08 21:38:50 +02:00
|
|
|
uses: actions/checkout@v2
|
2021-10-18 11:42:59 +02:00
|
|
|
-
|
|
|
|
name: Get Version of NetBox Docker
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=version::$(cat VERSION)"
|
|
|
|
shell: bash
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
id: buildx-setup
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
install: true
|
|
|
|
-
|
|
|
|
name: Available platforms
|
|
|
|
run: echo ${{ steps.buildx-setup.outputs.platforms }}
|
|
|
|
-
|
|
|
|
id: docker-build
|
2020-01-17 18:10:36 +01:00
|
|
|
name: Build the image with '${{ matrix.build_cmd }}'
|
2019-12-23 17:53:19 +01:00
|
|
|
run: ${{ matrix.build_cmd }}
|
|
|
|
env:
|
|
|
|
GH_ACTION: enable
|
2021-10-18 11:42:59 +02:00
|
|
|
-
|
2020-01-17 18:10:36 +01:00
|
|
|
name: Test the image
|
2019-12-23 17:53:19 +01:00
|
|
|
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
2020-01-17 18:10:36 +01:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
2021-10-18 11:42:59 +02:00
|
|
|
|
|
|
|
# docker.io
|
|
|
|
-
|
|
|
|
name: Login to docker.io
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: docker.io
|
|
|
|
username: ${{ secrets.dockerhub_username }}
|
|
|
|
password: ${{ secrets.dockerhub_password }}
|
2020-01-17 18:10:36 +01:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
2021-10-18 11:42:59 +02:00
|
|
|
-
|
|
|
|
name: Push the image to docker.io
|
2019-12-23 17:53:19 +01:00
|
|
|
run: ${{ matrix.build_cmd }} --push-only
|
2020-01-17 18:10:36 +01:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
2020-12-15 00:28:43 +01:00
|
|
|
|
2021-10-18 11:42:59 +02:00
|
|
|
# quay.io
|
|
|
|
-
|
|
|
|
name: Login to Quay.io
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: quay.io
|
|
|
|
username: ${{ secrets.quayio_username }}
|
|
|
|
password: ${{ secrets.quayio_password }}
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
-
|
|
|
|
name: Build and push the image with '${{ matrix.build_cmd }}'
|
|
|
|
run: ${{ matrix.build_cmd }} --push
|
2020-12-15 00:28:43 +01:00
|
|
|
env:
|
|
|
|
DOCKER_REGISTRY: quay.io
|
|
|
|
GH_ACTION: enable
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
2021-10-18 11:42:59 +02:00
|
|
|
|
|
|
|
# ghcr.io
|
|
|
|
-
|
|
|
|
name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2020-12-15 00:28:43 +01:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
2021-10-18 11:42:59 +02:00
|
|
|
-
|
|
|
|
name: Build and push the image with '${{ matrix.build_cmd }}'
|
|
|
|
run: ${{ matrix.build_cmd }} --push
|
2020-12-15 00:28:43 +01:00
|
|
|
env:
|
2021-10-18 11:42:59 +02:00
|
|
|
DOCKER_REGISTRY: ghcr.io
|
|
|
|
DOCKER_ORG: netbox-community
|
|
|
|
GH_ACTION: enable
|
2020-12-15 00:28:43 +01:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|