Skip to content

Commit 8a99842

Browse files
committed
ci: run preview deploys concurrently
1 parent 4647dee commit 8a99842

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,16 @@ jobs:
285285
echo "branch_slug=${BRANCH_SLUG}" >> "$GITHUB_OUTPUT"
286286
echo "short_sha=${SHORT_SHA}" >> "$GITHUB_OUTPUT"
287287
288-
pnpm exec wrangler deploy --config wrangler.preview.json --dispatch-namespace preview-deployments --name "${SHORT_SHA}"
289-
pnpm exec wrangler deploy --config wrangler.preview.json --dispatch-namespace preview-deployments --name "${BRANCH_SLUG}"
288+
# These two deploys are independent (different Worker names in the
289+
# same dispatch namespace), so run them concurrently instead of
290+
# back-to-back.
291+
pnpm exec wrangler deploy --config wrangler.preview.json --dispatch-namespace preview-deployments --name "${SHORT_SHA}" &
292+
short_sha_pid=$!
293+
pnpm exec wrangler deploy --config wrangler.preview.json --dispatch-namespace preview-deployments --name "${BRANCH_SLUG}" &
294+
branch_slug_pid=$!
295+
296+
wait "$short_sha_pid"
297+
wait "$branch_slug_pid"
290298
291299
- name: Post preview URL on PR
292300
env:

0 commit comments

Comments
 (0)