Skip to content

Commit 02c31fb

Browse files
committed
Only run the Docker build when relevant changes are made
The Docker build is comparatively slow (1-2 minutes) and mostly redundant given that the majority of PRs change docs content rather than configuration or build system.
1 parent 8ca19f2 commit 02c31fb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/validate.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,31 @@ jobs:
2828
- name: Build & Validate
2929
run: rake validate
3030

31+
changes:
32+
runs-on: ubuntu-latest
33+
if: github.ref != 'refs/heads/master'
34+
permissions:
35+
pull-requests: read
36+
outputs:
37+
docker: ${{ steps.filter.outputs.docker }}
38+
steps:
39+
- uses: dorny/paths-filter@v2
40+
id: filter
41+
with:
42+
filters: |
43+
docker:
44+
- '_config.yml'
45+
- '.dockerignore'
46+
- '.github/workflows/validate.yml'
47+
- '*docker*'
48+
- 'Dockerfile'
49+
- 'Gemfile*'
50+
- 'package*.json'
51+
- 'Rakefile'
52+
3153
docker:
54+
needs: changes
55+
if: needs.changes.outputs.docker == 'true' || github.ref == 'refs/heads/master'
3256
runs-on: ubuntu-latest
3357
steps:
3458
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)