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

52 lines
1.5 KiB
YAML
Raw Normal View History

2020-01-23 09:35:30 +01:00
name: release
on:
push:
branches:
- release
schedule:
- cron: '45 5 * * *'
jobs:
build:
strategy:
matrix:
build_cmd:
- ./build-latest.sh
- PRERELEASE=true ./build-latest.sh
- ./build-branches.sh
fail-fast: false
runs-on: ubuntu-latest
name: Builds new Netbox Docker Images
steps:
2020-01-17 18:10:36 +01:00
- id: git-checkout
name: Checkout
uses: actions/checkout@v1
2020-01-17 18:10:36 +01:00
- id: docker-build
name: Build the image with '${{ matrix.build_cmd }}'
run: ${{ matrix.build_cmd }}
env:
GH_ACTION: enable
2020-01-17 18:10:36 +01:00
- id: docker-test
name: Test the image
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
2020-01-17 18:10:36 +01:00
if: steps.docker-build.outputs.skipped != 'true'
- id: registry-login
name: Login to the Docker Registry
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 18:10:36 +01:00
if: steps.docker-build.outputs.skipped != 'true'
- id: registry-push
name: Push the image
run: ${{ matrix.build_cmd }} --push-only
2020-01-17 18:10:36 +01:00
if: steps.docker-build.outputs.skipped != 'true'
- id: registry-logout
name: Logout of the Docker Registry
run: docker logout "${DOCKER_REGISTRY}"
2020-01-17 18:10:36 +01:00
if: steps.docker-build.outputs.skipped != 'true'