Skip to content

Commit

Permalink
Merge pull request #138 from vladgh:filters
Browse files Browse the repository at this point in the history
Do not build images that are not changed
  • Loading branch information
vladgh authored Sep 11, 2021
2 parents 410673f + 3d0d147 commit 9304809
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]
- name: Detect changes
uses: dorny/[email protected]
id: filter
with:
filters: |
build:
- ${{ matrix.image.path }}/!(**.md)
- name: Docker Metadata
uses: docker/[email protected]
id: meta
if: steps.filter.outputs.build == 'true'
with:
images: ${{ matrix.image.name }}
tags: |
Expand All @@ -50,16 +58,19 @@ jobs:
type=sha
- name: Set up QEMU
uses: docker/[email protected]
if: steps.filter.outputs.build == 'true'
- name: Set up Docker BuildX
uses: docker/[email protected]
if: steps.filter.outputs.build == 'true'
- name: Login to DockerHub
uses: docker/[email protected]
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && steps.filter.outputs.build == 'true'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/[email protected]
if: steps.filter.outputs.build == 'true'
with:
context: ${{ matrix.image.path }}
platforms: ${{ matrix.image.platforms }}
Expand Down

0 comments on commit 9304809

Please sign in to comment.