-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from vladgh:filters
Do not build images that are not changed
- Loading branch information
Showing
1 changed file
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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 }} | ||
|