Skip to content

Commit b6af6ab

Browse files
committed
add filters to build workflow
1 parent b67edb3 commit b6af6ab

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed
File renamed without changes.

.github/workflows/build.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,22 @@ on:
99
- master
1010

1111
jobs:
12+
filters:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
found_main_changes: ${{ steps.filter.outputs.main_image_files }}
16+
found_minimal_changes: ${{ steps.filter.outputs.minimal_image_files }}
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: dorny/[email protected]
20+
id: filter
21+
with:
22+
filters: '.github/filter.yml'
23+
1224
build:
1325
runs-on: ubuntu-latest
26+
needs: filters
27+
if: needs.filters.outputs.found_main_changes
1428

1529
steps:
1630
- uses: actions/checkout@v2

.github/workflows/octoprint-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ on:
1111
jobs:
1212
# This job ensures image is only deployed when files that make up the image are changed
1313
# (changing docs or build scripts won't result in a push to registry)
14-
changes:
14+
filters:
1515
runs-on: ubuntu-latest
1616
outputs:
17-
deploy_main: ${{ steps.filter.outputs.main_image_files }}
18-
deploy_minimal: ${{ steps.filter.outputs.minimal_image_files }}
17+
found_main_image_changes: ${{ steps.filter.outputs.main_image_files }}
18+
found_minimal_image_changes: ${{ steps.filter.outputs.minimal_image_files }}
1919
steps:
2020
- uses: actions/checkout@v2
2121
- uses: dorny/[email protected]
2222
if: ${{ github.event_name == 'push'}}
2323
id: filter
2424
with:
25-
filters: '.github/deploy_rules.yml'
25+
filters: '.github/filters.yml'
2626

2727
release:
2828
runs-on: ubuntu-latest
29-
needs: changes
30-
if: github.event_name == 'repository_dispatch' || needs.changes.outputs.deploy == 'true'
29+
needs: filters
30+
if: github.event_name == 'repository_dispatch' || needs.filters.outputs.found_main_changes == 'true'
3131
strategy:
3232
matrix:
3333
tags: ['latest','%X%', '%X.Y%', '%X.Y.Z%']

0 commit comments

Comments
 (0)