Skip to content

Commit 7b5c86b

Browse files
committed
simplify
1 parent b5ebc20 commit 7b5c86b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 5 additions & 7 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' }}
76+
BUILD: ${{ steps.build_conditionals.outputs.first_or_force_build || steps.build_conditionals.outputs.automatic_rebuild }}
7777

7878
runs-on: "ubuntu-latest"
7979
steps:
@@ -159,12 +159,10 @@ jobs:
159159
id: build_conditionals
160160
run: |
161161
set -euo pipefail
162-
# always build if the workflow is manually triggered with --build flag
163-
echo "build_condition_1=${{ github.event.inputs.build }}" >> $GITHUB_OUTPUT
164-
# build if the workflow is manually triggered and the deployment doesn't exist
165-
echo "build_condition_2=${{ github.event_name == 'workflow_dispatch' && steps.check_deployment.outputs.NEW == 'true' }}" >> $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
162+
# build if the workflow is manually triggered and the deployment doesn't exist (first build or force rebuild)
163+
echo "first_or_force_build=${{ (github.event_name == 'workflow_dispatch' && steps.check_deployment.outputs.NEW == 'true') || github.event.inputs.build }}" >> $GITHUB_OUTPUT
164+
# build if the deployment alreday exist and there are changes in the files that we care about (automatic updates)
165+
echo "automatic_rebuild=${{ steps.check_deployment.outputs.NEW == 'false' && steps.filter.outputs.all_count > steps.filter.outputs.ignored_count }}" >> $GITHUB_OUTPUT
168166
169167
comment-pr:
170168
needs: [check_pr, get_info]

0 commit comments

Comments
 (0)