Cloudflare Pages auto-deploy
AI-generated content
This document was generated by an AI assistant. Verify accuracy before relying on the details.
Two Cloudflare Pages projects are wired to this repo: adb-doc (the VuePress docs site you're reading) and a future adb-ui Pages project for the Angular SPA. Both use Cloudflare's GitHub integration: pushes to the production branch deploy to production, branch pushes deploy as previews. No CI workflow on our side is needed — Cloudflare's worker pulls from GitHub directly. The Cloudflare account is 1379698ad9265ac44bb3a42edf022a35 (Life-Connect).
At a glance
| Project | Source | Build root | Production branch | Build command | Output dir |
|---|---|---|---|---|---|
adb-doc | hlc-lifeconnect/adb | adb-doc | main | yarn install && yarn docs:build | docs/.vuepress/dist |
adb-ui (planned) | hlc-lifeconnect/adb | adb-ui | TBD | TBD | TBD |
Preview deployments: enabled, all branches included.
Details
How adb-doc actually deploys
sequenceDiagram
participant Dev
participant GitHub
participant CFPages as Cloudflare Pages
participant CDN as Cloudflare CDN
Dev->>GitHub: git push origin main
GitHub->>CFPages: webhook (branch=main, sha=…)
CFPages->>GitHub: clone repo
CFPages->>CFPages: cd adb-doc/ && yarn install && yarn docs:build
CFPages->>CDN: upload docs/.vuepress/dist
CFPages-->>Dev: deployment URL (in PR comment if PR)
Production deployments go to https://adb-doc.pages.dev. Preview deployments get a stable per-PR URL (<pr>.<project>.pages.dev) plus a per-deployment URL (<deploy-id>.<project>.pages.dev).
Common gotchas
- Failed deployments stay visible in the dashboard — they don't auto-clear. If you see "9 idle deployments" in
Deployments, those are usually old build-slot races; cancel them via the dashboard. - The free tier allows 1 concurrent build per project. If you trigger many pushes quickly, deployments queue.
- The build root matters: it must be
adb-doc/(not/). Setting it wrong makesyarn installrun at repo root where there's nopackage.json, and the build fails. - VuePress doesn't render Mermaid
graphkeyword reliably after the chevrotain v12 upgrade — useflowchartinstead. See commit60406e7.
Reading deploy state via API
# In ~/.zshrc.local (gitignored): export CLOUDFLARE_API_TOKEN=...
ACCT=1379698ad9265ac44bb3a42edf022a35
curl -sS -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
"https://api.cloudflare.com/client/v4/accounts/$ACCT/pages/projects/adb-doc/deployments?per_page=10" \
| jq '.result[] | {created_on, branch: .deployment_trigger.metadata.branch, sha: .deployment_trigger.metadata.commit_hash, status: .latest_stage.status}'
The API token needs Account → Cloudflare Pages → Read (separate permission group from Workers Scripts).
Open questions
- Should we add a GitHub Action that fails the PR check if the Cloudflare deploy errors out? Today CF posts the deploy URL as a PR comment but a build failure doesn't block merge.
- For
adb-ui: should it use Cloudflare Pages (current direction) or stay on the legacy AKS-served nginx until a planned cutover?