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 Oct 22, 2023
1 parent f108c6d commit b922880
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/main'
permissions:
pull-requests: read
outputs:
docker: ${{ steps.filter.outputs.docker }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docker:
- '_config.yml'
- '.dockerignore'
- '.github/workflows/validate.yml'
- '*docker*'
- 'Dockerfile'
- 'Gemfile*'
- 'package*.json'
- 'Rakefile'
docker:
needs: changes
if: needs.changes.outputs.docker == 'true' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit b922880

Please sign in to comment.