Skip to content

Commit

Permalink
fixup! ci: limit build to changed templates
Browse files Browse the repository at this point in the history
  • Loading branch information
endersonmaia committed Sep 4, 2023
1 parent 41f18df commit 9eb6fa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "ALL_TEMPLATES=$(find ./ -name Dockerfile | awk -F/ '/^[a-z]*\// {print $1}' | sort -u | jq -Rnc '[inputs]')" >> "$GITHUB_OUTPUT"
build-on-main:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.changedfiles.outputs.allTemplates}}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && (needs.changedfiles.outputs.changedTemplates != '' && toJson(fromjson(needs.changedfiles.outputs.changedTemplates)) ! = '[]') }}
needs: changedfiles
name: sunodo build ${{ matrix.allTemplates }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
working-directory: ${{ matrix.ALL_TEMPLATES }}

build-on-pr:
if: ${{ github.event_name == 'pull_request' && needs.changedfiles.outputs.changedTemplates }}
if: ${{ github.event_name == 'pull_request' && (needs.changedfiles.outputs.changedTemplates != '' && toJson(fromjson(needs.changedfiles.outputs.changedTemplates)) ! = '[]') }}
needs: changedfiles
name: sunodo build ${{ matrix.changedTemplates }}
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9eb6fa8

Please sign in to comment.