ci(demo): auto-create Pages project on first deploy (idempotent)
Project not found errors when pcbjam-demo doesn't exist yet; create it (with the production branch matching --branch) before deploying so the pipeline is self-contained. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4261d90683
commit
f3683bda39
1 changed files with 11 additions and 1 deletions
12
.github/workflows/deploy-demo.yml
vendored
12
.github/workflows/deploy-demo.yml
vendored
|
|
@ -84,7 +84,17 @@ jobs:
|
|||
- name: Build demo
|
||||
run: node scripts/deploy/build-demo.mjs --tag "${{ steps.tag.outputs.tag }}" --cdn "$CDN"
|
||||
|
||||
# 4) Deploy to Cloudflare Pages (demo.pcbjam.com is the project's custom domain).
|
||||
# 4) Ensure the Pages project exists (first deploy creates it; no-op after).
|
||||
# Its production branch must equal PAGES_PROD_BRANCH or deploys land as
|
||||
# previews and demo.pcbjam.com won't update.
|
||||
- name: Ensure Pages project exists
|
||||
run: >
|
||||
npx --yes wrangler@4 pages project create "$PAGES_PROJECT"
|
||||
--production-branch "$PAGES_PROD_BRANCH"
|
||||
|| echo "pages project create skipped (already exists)"
|
||||
|
||||
# 5) Deploy to Cloudflare Pages. Attach demo.pcbjam.com to this project
|
||||
# (Pages → $PAGES_PROJECT → Custom domains) for the custom domain to serve it.
|
||||
- name: Deploy to Cloudflare Pages
|
||||
run: >
|
||||
npx --yes wrangler@4 pages deploy web/standalone/dist
|
||||
|
|
|
|||
Loading…
Reference in a new issue