mirror of
https://github.com/netbox-community/netbox-docker.git
synced 2025-12-11 06:12:37 +00:00
add workflow trigger for releases only
This commit is contained in:
parent
a35bce8d93
commit
ddfdcc8463
86
.github/workflows/push.yml
vendored
86
.github/workflows/push.yml
vendored
|
|
@ -1,86 +0,0 @@
|
||||||
---
|
|
||||||
name: push
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches-ignore:
|
|
||||||
- release
|
|
||||||
pull_request:
|
|
||||||
branches-ignore:
|
|
||||||
- release
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Checks syntax of our code
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
# Full git history is needed to get a proper
|
|
||||||
# list of changed files within `super-linter`
|
|
||||||
fetch-depth: 0
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
- name: Lint Code Base
|
|
||||||
uses: github/super-linter@v5
|
|
||||||
env:
|
|
||||||
DEFAULT_BRANCH: develop
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
SUPPRESS_POSSUM: true
|
|
||||||
LINTER_RULES_PATH: /
|
|
||||||
VALIDATE_ALL_CODEBASE: false
|
|
||||||
VALIDATE_DOCKERFILE: false
|
|
||||||
VALIDATE_GITLEAKS: false
|
|
||||||
FILTER_REGEX_EXCLUDE: (.*/)?(LICENSE|configuration/.*)
|
|
||||||
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
|
|
||||||
YAML_CONFIG_FILE: .yamllint.yaml
|
|
||||||
build:
|
|
||||||
continue-on-error: ${{ matrix.build_cmd != './build-latest.sh' }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
build_cmd:
|
|
||||||
- ./build-latest.sh
|
|
||||||
- PRERELEASE=true ./build-latest.sh
|
|
||||||
- ./build.sh feature
|
|
||||||
- ./build.sh develop
|
|
||||||
platform:
|
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
fail-fast: false
|
|
||||||
env:
|
|
||||||
GH_ACTION: enable
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
IMAGE_NAMES: docker.io/netboxcommunity/netbox
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Builds new NetBox Docker Images
|
|
||||||
steps:
|
|
||||||
- id: git-checkout
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- id: qemu-setup
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- id: buildx-setup
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- id: docker-build
|
|
||||||
name: Build the image for '${{ matrix.platform }}' with '${{ matrix.build_cmd }}'
|
|
||||||
run: ${{ matrix.build_cmd }}
|
|
||||||
env:
|
|
||||||
BUILDX_PLATFORM: ${{ matrix.platform }}
|
|
||||||
BUILDX_BUILDER_NAME: ${{ steps.buildx-setup.outputs.name }}
|
|
||||||
- id: arm-time-limit
|
|
||||||
name: Set Netbox container start_period higher on ARM64
|
|
||||||
if: matrix.platform == 'linux/arm64'
|
|
||||||
run: |
|
|
||||||
echo "NETBOX_START_PERIOD=240s" >>"${GITHUB_ENV}"
|
|
||||||
- id: docker-test
|
|
||||||
name: Test the image
|
|
||||||
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
|
||||||
if: steps.docker-build.outputs.skipped != 'true'
|
|
||||||
23
.github/workflows/release.yml
vendored
23
.github/workflows/release.yml
vendored
|
|
@ -15,9 +15,6 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
build_cmd:
|
build_cmd:
|
||||||
- ./build-latest.sh
|
- ./build-latest.sh
|
||||||
- PRERELEASE=true ./build-latest.sh
|
|
||||||
- ./build.sh feature
|
|
||||||
- ./build.sh develop
|
|
||||||
platform:
|
platform:
|
||||||
- linux/amd64,linux/arm64
|
- linux/amd64,linux/arm64
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
@ -26,7 +23,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GH_ACTION: enable
|
GH_ACTION: enable
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
IMAGE_NAMES: docker.io/netboxcommunity/netbox quay.io/netboxcommunity/netbox ghcr.io/netbox-community/netbox
|
IMAGE_NAMES: ghcr.io/netbox-community/netbox
|
||||||
steps:
|
steps:
|
||||||
- id: source-checkout
|
- id: source-checkout
|
||||||
name: Checkout
|
name: Checkout
|
||||||
|
|
@ -48,24 +45,6 @@ jobs:
|
||||||
name: Test the image
|
name: Test the image
|
||||||
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh
|
||||||
if: steps.docker-build.outputs.skipped != 'true'
|
if: steps.docker-build.outputs.skipped != 'true'
|
||||||
# docker.io
|
|
||||||
- id: docker-io-login
|
|
||||||
name: Login to docker.io
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: docker.io
|
|
||||||
username: ${{ secrets.dockerhub_username }}
|
|
||||||
password: ${{ secrets.dockerhub_password }}
|
|
||||||
if: steps.docker-build.outputs.skipped != 'true'
|
|
||||||
# quay.io
|
|
||||||
- id: quay-io-login
|
|
||||||
name: Login to Quay.io
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: quay.io
|
|
||||||
username: ${{ secrets.quayio_username }}
|
|
||||||
password: ${{ secrets.quayio_password }}
|
|
||||||
if: steps.docker-build.outputs.skipped != 'true'
|
|
||||||
# ghcr.io
|
# ghcr.io
|
||||||
- id: ghcr-io-login
|
- id: ghcr-io-login
|
||||||
name: Login to GitHub Container Registry
|
name: Login to GitHub Container Registry
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue