Skip to content

Commit

Permalink
Build only on detect changes
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Apr 9, 2024
1 parent 20c854e commit 080c9f1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ name: Test build
on: push

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'variants' output variable
image_variants: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
# https://github.com/marketplace/actions/paths-changes-filter#conditional-execution
id: filter
with:
filters: |
Dockerfile: Dockerfile
Dockerfile-deb: Dockerfile-deb
build:
name: Setup, Build
runs-on: ubuntu-latest
Expand All @@ -11,9 +25,7 @@ jobs:
max-parallel: 6
# select a core set of images to build
matrix:
IMAGE_VARIANT:
- Dockerfile
- Dockerfile-deb
IMAGE_VARIANT: ${{ fromJSON(needs.detect-changes.outputs.image_variants) }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down

0 comments on commit 080c9f1

Please sign in to comment.