Skip to content

Commit b5ebc20

Browse files
committed
fixed
1 parent ed7744f commit b5ebc20

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
CODER_BASE_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_BASE_IMAGE_TAG }}
7474
CODER_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_IMAGE_TAG }}
7575
NEW: ${{ steps.check_deployment.outputs.NEW }}
76-
BUILD: ${{ steps.build_conditionals.outputs.build_condition_1 == 'true' || steps.build_conditionals.outputs.build_condition_2 == 'true' || steps.build_conditionals.outputs.build_condition_3 == 'true' || steps.build_conditionals.outputs.build_condition_4 == 'true' }}
76+
BUILD: ${{ steps.build_conditionals.outputs.build_condition_1 == 'true' || steps.build_conditionals.outputs.build_condition_2 == 'true' || steps.build_conditionals.outputs.build_condition_3 == 'true' }}
7777

7878
runs-on: "ubuntu-latest"
7979
steps:
@@ -159,10 +159,12 @@ jobs:
159159
id: build_conditionals
160160
run: |
161161
set -euo pipefail
162+
# always build if the workflow is manually triggered with --build flag
162163
echo "build_condition_1=${{ github.event.inputs.build }}" >> $GITHUB_OUTPUT
164+
# build if the workflow is manually triggered and the deployment doesn't exist
163165
echo "build_condition_2=${{ github.event_name == 'workflow_dispatch' && steps.check_deployment.outputs.NEW == 'true' }}" >> $GITHUB_OUTPUT
164-
echo "build_condition_3=${{ github.event_name == 'push' && steps.check_deployment.outputs.NEW == 'false' && steps.filter.outputs.all_count > steps.filter.outputs.ignored_count }}" >> $GITHUB_OUTPUT
165-
echo "build_condition_4=${{ steps.check_deployment.outputs.NEW == 'false' && steps.filter.outputs.all_count > steps.filter.outputs.ignored_count }}" >> $GITHUB_OUTPUT
166+
# build if the deployment alreday exist and there are changes in the files that we care about (this case covers PR updates)
167+
echo "build_condition_3=${{ steps.check_deployment.outputs.NEW == 'false' && steps.filter.outputs.all_count > steps.filter.outputs.ignored_count }}" >> $GITHUB_OUTPUT
166168
167169
comment-pr:
168170
needs: [check_pr, get_info]

0 commit comments

Comments
 (0)