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

90 lines
2.4 KiB
YAML
Raw Normal View History

2020-01-23 09:35:30 +01:00
name: push
on:
2021-03-14 17:27:20 +01:00
push:
2020-01-30 15:48:01 +01:00
branches-ignore:
- release
2021-03-14 17:45:56 +01:00
pull_request:
branches-ignore:
- release
jobs:
2021-02-08 11:59:57 +01:00
lint:
runs-on: ubuntu-latest
name: Checks syntax of our code
steps:
2021-09-17 20:57:26 +02:00
-
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
2021-09-17 20:57:26 +02:00
-
uses: actions/setup-python@v2
-
name: Lint Code Base
uses: github/super-linter@v4
2021-02-08 11:59:57 +01:00
env:
DEFAULT_BRANCH: develop
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SUPPRESS_POSSUM: true
LINTER_RULES_PATH: /
VALIDATE_ALL_CODEBASE: false
VALIDATE_DOCKERFILE: false
2021-02-10 10:48:45 +01:00
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
2021-02-08 11:59:57 +01:00
EDITORCONFIG_FILE_NAME: .ecrc
DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yaml
MARKDOWN_CONFIG_FILE: .markdown-lint.yml
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
PYTHON_FLAKE8_CONFIG_FILE: .flake8
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
2021-09-17 20:57:26 +02:00
build:
continue-on-error: ${{ matrix.docker_from == 'alpine:edge' }}
strategy:
matrix:
build_cmd:
- ./build-latest.sh
- PRERELEASE=true ./build-latest.sh
- ./build.sh feature
- ./build.sh develop
docker_from:
- '' # use the default of the build script
2021-03-12 16:55:51 +01:00
platform:
- linux/amd64
- linux/arm64
fail-fast: false
runs-on: ubuntu-latest
name: Builds new NetBox Docker Images
steps:
2021-09-17 20:57:26 +02:00
-
2020-01-17 18:10:36 +01:00
name: Checkout
2021-01-31 12:55:20 +01:00
uses: actions/checkout@v2
2021-09-17 20:57:26 +02:00
-
2021-03-14 17:11:45 +01:00
name: Get Version of NetBox Docker
run: |
echo "::set-output name=version::$(cat VERSION)"
shell: bash
2021-09-17 20:57:26 +02:00
-
2021-03-12 16:55:51 +01:00
name: Set up QEMU
uses: docker/setup-qemu-action@v1
2021-09-17 20:57:26 +02:00
-
id: buildx-setup
2021-03-12 16:55:51 +01:00
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
2021-09-17 20:57:26 +02:00
-
id: docker-build
2020-01-17 18:10:36 +01:00
name: Build the image from '${{ matrix.docker_from }}' with '${{ matrix.build_cmd }}'
run: ${{ matrix.build_cmd }}
env:
DOCKER_FROM: ${{ matrix.docker_from }}
GH_ACTION: enable
2021-03-12 16:55:51 +01:00
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}
2021-03-14 17:11:45 +01:00
BUILDX_PLATFORMS: ${{ matrix.platform }}
2021-09-17 20:57:26 +02:00
-
2020-01-17 18:10:36 +01:00
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'