2020-01-23 02:35:30 -06:00
|
|
|
name: release
|
|
|
|
|
2019-12-23 10:53:19 -06:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- release
|
|
|
|
schedule:
|
|
|
|
- cron: '45 5 * * *'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_cmd:
|
|
|
|
- ./build-latest.sh
|
|
|
|
- PRERELEASE=true ./build-latest.sh
|
2020-04-08 14:38:50 -05:00
|
|
|
- ./build-next.sh
|
|
|
|
- ./build.sh develop
|
2019-12-23 10:53:19 -06:00
|
|
|
fail-fast: false
|
|
|
|
runs-on: ubuntu-latest
|
2021-02-04 14:48:08 -06:00
|
|
|
name: Builds new NetBox Docker Images
|
2019-12-23 10:53:19 -06:00
|
|
|
steps:
|
2020-01-17 11:10:36 -06:00
|
|
|
- id: git-checkout
|
|
|
|
name: Checkout
|
2020-04-08 14:38:50 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-01-17 11:10:36 -06:00
|
|
|
- id: docker-build
|
|
|
|
name: Build the image with '${{ matrix.build_cmd }}'
|
2019-12-23 10:53:19 -06:00
|
|
|
run: ${{ matrix.build_cmd }}
|
|
|
|
env:
|
|
|
|
GH_ACTION: enable
|
2020-01-17 11:10:36 -06:00
|
|
|
- id: docker-test
|
|
|
|
name: Test the image
|
2019-12-23 10:53:19 -06:00
|
|
|
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
2020-01-17 11:10:36 -06:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
- id: registry-login
|
|
|
|
name: Login to the Docker Registry
|
2019-12-23 10:53:19 -06:00
|
|
|
run: |
|
|
|
|
echo "::add-mask::$DOCKERHUB_USERNAME"
|
|
|
|
echo "::add-mask::$DOCKERHUB_PASSWORD"
|
|
|
|
docker login -u "$DOCKERHUB_USERNAME" --password "${DOCKERHUB_PASSWORD}" "${DOCKER_REGISTRY}"
|
|
|
|
env:
|
|
|
|
DOCKERHUB_USERNAME: ${{ secrets.dockerhub_username }}
|
|
|
|
DOCKERHUB_PASSWORD: ${{ secrets.dockerhub_password }}
|
2020-01-17 11:10:36 -06:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
- id: registry-push
|
|
|
|
name: Push the image
|
2019-12-23 10:53:19 -06:00
|
|
|
run: ${{ matrix.build_cmd }} --push-only
|
2020-01-17 11:10:36 -06:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
- id: registry-logout
|
|
|
|
name: Logout of the Docker Registry
|
2019-12-23 10:53:19 -06:00
|
|
|
run: docker logout "${DOCKER_REGISTRY}"
|
2020-01-17 11:10:36 -06:00
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
2020-12-14 17:28:43 -06:00
|
|
|
|
|
|
|
# Quay.io
|
|
|
|
- id: quayio-docker-build
|
|
|
|
name: Build the image with '${{ matrix.build_cmd }}'
|
|
|
|
run: ${{ matrix.build_cmd }}
|
|
|
|
env:
|
|
|
|
DOCKER_REGISTRY: quay.io
|
|
|
|
GH_ACTION: enable
|
|
|
|
- id: quayio-registry-login
|
|
|
|
name: Login to the Quay.io Registry
|
|
|
|
run: |
|
|
|
|
echo "::add-mask::$QUAYIO_USERNAME"
|
|
|
|
echo "::add-mask::$QUAYIO_PASSWORD"
|
|
|
|
docker login -u "$QUAYIO_USERNAME" --password "${QUAYIO_PASSWORD}" "${DOCKER_REGISTRY}"
|
|
|
|
env:
|
|
|
|
DOCKER_REGISTRY: quay.io
|
|
|
|
QUAYIO_USERNAME: ${{ secrets.quayio_username }}
|
|
|
|
QUAYIO_PASSWORD: ${{ secrets.quayio_password }}
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
- id: quayio-registry-push
|
|
|
|
name: Push the image
|
|
|
|
run: ${{ matrix.build_cmd }} --push-only
|
|
|
|
env:
|
|
|
|
DOCKER_REGISTRY: quay.io
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|
|
|
|
- id: quayio-registry-logout
|
|
|
|
name: Logout of the Docker Registry
|
|
|
|
run: docker logout "${DOCKER_REGISTRY}"
|
|
|
|
env:
|
|
|
|
DOCKER_REGISTRY: quay.io
|
|
|
|
if: steps.docker-build.outputs.skipped != 'true'
|