Skip to content

Commit

Permalink
Skip CI runs when no docker files changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Mar 30, 2024
1 parent 6ceb1f9 commit b3ab864
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
name: Build

on: push
on:
push:
branches: [main]
pull_request:

jobs:
docker:
runs-on: ubuntu-latest
env:
NETBOX_VERSION: v3.7.1
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: true
files: docker/*
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -28,6 +37,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
if: steps.changed-files.outputs.any_changed == 'true'
with:
context: "{{defaultContext}}:docker"
build-args: NETBOX_VERSION=${{ env.NETBOX_VERSION }}
Expand Down

0 comments on commit b3ab864

Please sign in to comment.