Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Heinrich <[email protected]>
  • Loading branch information
andistorm committed Jul 8, 2024
1 parent abe9170 commit b361acc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy-single-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ on:

jobs:
check:
if: ${{ inputs.force_rebuild == 'false' }}
name: Check for changes
outputs:
rebuild: ${{ steps.set-outputs.outputs.rebuild }}
Expand Down Expand Up @@ -121,7 +122,7 @@ jobs:
if: steps.validate-inputs.outputs.validation_failed == 'false'
id: check
run: |
echo "Checking for changes in ${{ inputs.directory }}.."
echo "Checking for changes in paths ${{ steps.setup-regex.outputs.regex }}.."
changed_files="$(git diff --name-only ${{ inputs.github_ref_before }} ${{ inputs.github_ref_after }} | grep -E '${{ steps.setup-regex.outputs.regex }}')"
changed_files_count=$(echo "$changed_files" | wc -l)
if [ $changed_files_count -gt 0 ]; then
Expand All @@ -141,7 +142,7 @@ jobs:
build-and-push:
name: Build and push
needs: check
if: ${{ needs.check.outputs.rebuild || inputs.force_rebuild }}
if: ${{ needs.check.outputs.rebuild == 'true' || inputs.force_rebuild == 'true' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout Dockerfile
Expand Down

0 comments on commit b361acc

Please sign in to comment.