Skip to content

Commit 4256312

Browse files
committed
externalize build filters
1 parent efd7f4b commit 4256312

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/deploy_rules.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
main_image_files:
2+
- 'Dockerfile'
3+
- 'root/**'
4+
minimal_image_files:
5+
- 'minimal/**'

.github/workflows/octoprint-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ on:
99
- master
1010

1111
jobs:
12+
# This job ensures image is only deployed when files that make up the image are changed
13+
# (changing docs or build scripts won't result in a push to registry)
1214
changes:
1315
runs-on: ubuntu-latest
1416
outputs:
15-
deploy: ${{ steps.filter.outputs.deployable }}
17+
deploy_main: ${{ steps.filter.outputs.main_image_files }}
18+
deploy_minimal: ${{ steps.filter.outputs.minimal_image_files }}
1619
steps:
1720
- uses: actions/checkout@v2
1821
- uses: dorny/[email protected]
1922
if: ${{ github.event_name == 'push'}}
2023
id: filter
2124
with:
22-
filters: |
23-
deployable:
24-
- 'root/**'
25-
- Dockerfile
25+
filters: 'deploy_rules.yml'
2626

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

0 commit comments

Comments
 (0)