@@ -241,7 +241,15 @@ jobs:
241241 promote-trigger-dev :
242242 name : Promote Trigger.dev (Dev)
243243 needs : [build-dev, deploy-trigger-dev]
244- if : github.event_name == 'push' && github.ref == 'refs/heads/dev'
244+ # Run as long as the task upload succeeded, even if a NON-app build-dev leg
245+ # (realtime/pii/migrations) failed: the app leg pushes :dev independently and
246+ # may have already triggered the ECS deploy, so an unrelated image failure must
247+ # not strand the app on the old task version. The app-metadata artifact (only
248+ # the app leg uploads it) is the real signal that an app deploy happened.
249+ if : >-
250+ !cancelled() &&
251+ github.event_name == 'push' && github.ref == 'refs/heads/dev' &&
252+ needs.deploy-trigger-dev.result == 'success'
245253 runs-on : blacksmith-4vcpu-ubuntu-2404
246254 # Dev bake is 5 min; the poll budget (30 min) and session (40 min) are sized for
247255 # that with margin, well short of the prod path's 70/90.
@@ -272,20 +280,36 @@ jobs:
272280 - name : Install dependencies
273281 run : bun install --frozen-lockfile
274282
283+ # Tolerate a missing artifact: it's only uploaded by the app leg, so its
284+ # absence means the app image didn't build → no ECS deploy happened.
275285 - name : Download dev cutover metadata
286+ id : meta
287+ continue-on-error : true
276288 uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
277289 with :
278290 name : dev-cutover-meta
279291 path : dev-meta
280292
293+ - name : Determine whether an app deploy happened
294+ id : appdeploy
295+ run : |
296+ if [ -f dev-meta/app_image_changed.txt ]; then
297+ echo "deployed=true" >> "$GITHUB_OUTPUT"
298+ else
299+ echo "deployed=false" >> "$GITHUB_OUTPUT"
300+ echo "::warning::No app-image metadata (app leg did not build); skipping dev task promotion."
301+ fi
302+
281303 - name : Configure AWS credentials
304+ if : steps.appdeploy.outputs.deployed == 'true'
282305 uses : aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
283306 with :
284307 role-to-assume : ${{ secrets.DEV_AWS_ROLE_TO_ASSUME }}
285308 aws-region : ${{ secrets.DEV_AWS_REGION }}
286309 role-duration-seconds : 2400
287310
288311 - name : Wait for ECS traffic cutover
312+ if : steps.appdeploy.outputs.deployed == 'true'
289313 env :
290314 OVERALL_TIMEOUT : " 1800"
291315 run : |
@@ -300,6 +324,7 @@ jobs:
300324 bash .github/scripts/wait-for-ecs-cutover.sh sim-dev-us-east-1-app-deployment "$DIGEST" "$EPOCH"
301325
302326 - name : Promote Trigger.dev version
327+ if : steps.appdeploy.outputs.deployed == 'true'
303328 working-directory : ./apps/sim
304329 env :
305330 TRIGGER_ACCESS_TOKEN : ${{ secrets.DEV_TRIGGER_ACCESS_TOKEN }}
0 commit comments