Skip to content

Commit

Permalink
Only run the Docker build when relevant changes are made
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
PeterJCLaw committed Nov 19, 2022
1 parent 8ca19f2 commit 6d7b736
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,31 @@ jobs:
- name: Build & Validate
run: rake validate

changes:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
permissions:
pull-requests: read
outputs:
docker: ${{ steps.filter.outputs.docker }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docker:
- '_config.yml'
- '.dockerignore'
- '*docker*'
- 'Dockerfile'
- 'Gemfile*'
- 'package*.json'
- 'Rakefile'
- '.github/workflows/validate.yml'
docker:
needs: changes
if: needs.changes.outputs.docker == 'true' || github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down

0 comments on commit 6d7b736

Please sign in to comment.