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

88 lines
2.3 KiB
YAML
Raw Normal View History

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 * * *'
jobs:
build:
strategy:
matrix:
build_cmd:
- ./build-latest.sh
- PRERELEASE=true ./build-latest.sh
- ./build.sh feature
- ./build.sh develop
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
steps:
2021-10-18 04:42:59 -05:00
-
2020-01-17 11:10:36 -06:00
name: Checkout
2022-03-01 13:06:16 -06:00
uses: actions/checkout@v3
2021-10-18 04:42:59 -05:00
-
name: Get Version of NetBox Docker
run: |
echo "::set-output name=version::$(cat VERSION)"
shell: bash
-
id: docker-build
2020-01-17 11:10:36 -06:00
name: Build the image with '${{ matrix.build_cmd }}'
run: ${{ matrix.build_cmd }}
2021-10-18 04:42:59 -05:00
-
2020-01-17 11:10:36 -06:00
name: Test the image
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
2020-01-17 11:10:36 -06:00
if: steps.docker-build.outputs.skipped != 'true'
2021-10-18 04:42:59 -05:00
# docker.io
-
name: Login to docker.io
uses: docker/login-action@v2
2021-10-18 04:42:59 -05:00
with:
registry: docker.io
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_password }}
2020-01-17 11:10:36 -06:00
if: steps.docker-build.outputs.skipped != 'true'
2021-10-18 04:42:59 -05:00
-
name: Push the image to docker.io
run: ${{ matrix.build_cmd }} --push-only
2020-01-17 11:10:36 -06:00
if: steps.docker-build.outputs.skipped != 'true'
2020-12-14 17:28:43 -06:00
2021-10-18 04:42:59 -05:00
# quay.io
-
name: Login to Quay.io
uses: docker/login-action@v2
2021-10-18 04:42:59 -05:00
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-14 17:28:43 -06:00
env:
DOCKER_REGISTRY: quay.io
if: steps.docker-build.outputs.skipped != 'true'
2021-10-18 04:42:59 -05:00
# ghcr.io
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
2021-10-18 04:42:59 -05:00
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
2020-12-14 17:28:43 -06:00
if: steps.docker-build.outputs.skipped != 'true'
2021-10-18 04:42:59 -05:00
-
name: Build and push the image with '${{ matrix.build_cmd }}'
run: ${{ matrix.build_cmd }} --push
2020-12-14 17:28:43 -06:00
env:
2021-10-18 04:42:59 -05:00
DOCKER_REGISTRY: ghcr.io
DOCKER_ORG: netbox-community
2020-12-14 17:28:43 -06:00
if: steps.docker-build.outputs.skipped != 'true'