Everything needed to operate docs.onalead.com: one-time account setup, publishing content, and every supported deployment pipeline — interactive, unattended/CI, AI-agent, raw API, and point-and-click.
The main site (www.onalead.com) stays on GoDaddy, untouched. A single CNAME record hands the docs subdomain to a Cloudflare Pages project. Every deploy publishes to Cloudflare's global edge; DNS never changes again after setup.
[ GoDaddy DNS — apex authority, unchanged ]
|
+---------------+-----------------------+
| |
(www.onalead.com) (docs.onalead.com)
| |
[ GoDaddy Host ] CNAME docs → docs-hub-cyq.pages.dev
|
[ Cloudflare Pages — Free plan ]
|
deploys via CLI / CI / agent / API / web
Why not NS subdomain delegation?
Cloudflare's "subdomain setup" (delegating docs.onalead.com as its own zone via NS records) is an Enterprise-plan feature. The CNAME-backed Pages custom domain delivers the same isolation, zero cost, and edge delivery on the Free plan.
To publish a new resource: drop the HTML file into dist/resources/, add a link in dist/index.html, and deploy with any pipeline below.
URL normalization
Pages serves "pretty URLs": requesting /resources/my-doc.html returns a 308 redirect to /resources/my-doc. Both forms work — link either one.
04
API Token — the Key to Unattended Deploys
Interactive wrangler login uses a browser OAuth session that expires. Every unattended pipeline (CI, agents, scripts, raw API) instead uses a long-lived, narrowly-scoped API token.
Create the token
Cloudflare dashboard → My Profile → API Tokens → Create Token.
Use the custom token form with exactly one permission: Account · Cloudflare Pages · Edit, scoped to this account.
Name it for its consumer (e.g. ado-docs-hub-deploy) so it can be rotated independently.
Copy the token once — it is never shown again.
Use the token
Wrangler (and the Pages API) read two environment variables. Set them and no browser login is ever needed:
Security rules
Store the token only in secret stores (ADO secret variables, GitHub encrypted secrets, local env) — never in the repo, never in wrangler.jsonc. One permission, one account, one consumer per token. Rotate from the same dashboard page; revoking takes effect immediately.
05
Pipeline A — Wrangler CLI (Local)
The everyday workflow for a human at a terminal. From the onalead-docs repo:
shell · interactive deploy
# one-time per machine (browser OAuth)
npx wrangler login
# deploy — also available as: npm run deploy
npx wrangler pages deploy ./dist --project-name=docs-hub --branch=main
Output ends with a unique preview URL per deployment (e.g. https://c943062f.docs-hub-cyq.pages.dev) plus the production alias. Deploys typically complete in under 10 seconds; only changed files upload.
For unattended local scripts (scheduled tasks, build hooks), skip login entirely and set the two environment variables from §04 — the same command then runs headless.
06
Pipeline B — Azure DevOps (CI)
GitOps for teams already in ADO: push the onalead-docs repo to an ADO project, and every merge to main ships to the edge automatically.
Setup
Push the repo to ADO and create a pipeline from azure-pipelines.yml below.
Pipeline → Variables → add CLOUDFLARE_API_TOKEN with the value from §04, marked "Keep this value secret." (Or put it in a Library variable group.)
Branch previews for free
Pass --branch=$(Build.SourceBranchName) instead of --branch=main on PR builds and Cloudflare creates an isolated preview URL per branch — review the rendered docs before merging.
07
Pipeline C — GitHub Actions (CI)
If the repo lives on GitHub instead, the official wrangler-action does the same job. Add CLOUDFLARE_API_TOKEN as an encrypted repo secret (Settings → Secrets and variables → Actions).
Alternatively, Cloudflare's dashboard offers a native Git integration (Workers & Pages → docs-hub → Settings → Builds) that connects directly to a GitHub/GitLab repo and builds on every push — no workflow file at all. Note: native Git integration supports GitHub and GitLab only, not Azure Repos — which is why ADO uses the Wrangler step in §06.
08
Pipeline D — Claude & AI Agents (MCP / CLI)
Two ways to let an AI agent publish docs autonomously, from simplest to most integrated:
D1 · Claude Code + Wrangler (works today)
Claude Code drives the same Wrangler CLI a human would. With the §04 token in the environment, the agent deploys headlessly — write the HTML, drop it in dist/resources/, run the deploy, verify the URL, done in one prompt.
example agent prompt
# in D:\Users\JJKramer\repos\onalead-docs"Add the attached writeup as a new resource page, link it from the
index, deploy to Cloudflare Pages, and verify the live URL returns 200."
D2 · Cloudflare's native MCP servers
Cloudflare publishes remote Model Context Protocol servers that expose account operations (Workers/Pages builds, bindings, observability) as first-class tools to MCP clients like Claude Code and Claude Desktop, authenticated via OAuth:
On first use the browser opens for Cloudflare OAuth; afterwards the agent can inspect projects, builds, and logs through tool calls. The full catalog of servers is at github.com/cloudflare/mcp-server-cloudflare.
Recommended split
Use D1 (Wrangler + token) for the deploy itself — it is deterministic and CI-identical. Use D2 (MCP) when the agent needs to observe the account: list deployments, read build logs, debug a failed rollout.
09
Pipeline E — Raw REST API
Everything Wrangler does is a documented HTTP API — useful for custom tooling or platforms with no Node runtime. All calls authenticate with Authorization: Bearer $CLOUDFLARE_API_TOKEN.
# rollback production to a previous deployment
curl -X POST "$BASE/pages/projects/docs-hub/deployments/<DEPLOYMENT_ID>/rollback" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"# delete a deployment
curl -X DELETE "$BASE/pages/projects/docs-hub/deployments/<DEPLOYMENT_ID>" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
Creating deployments by raw API
Direct-upload deployments via bare HTTP require building a file-hash manifest and a multipart upload protocol. It is documented but fiddly — Wrangler is the supported wrapper around exactly this API, so for creating deployments prefer wrangler pages deploy even inside custom tooling (shell out or use the wrangler npm package programmatically).
10
Pipeline F — Web Upload (Dashboard)
Zero-tooling fallback: drag-and-drop in the browser. Good for emergencies or non-technical edits; the trade-off is no git history of what shipped.
Choose the main branch (production) and drag the contents of dist/ — or click "select from computer → upload folder" and pick the dist folder itself.
Save and deploy. The edge updates in seconds.
Upload the whole bundle
A web upload replaces the deployment's file set — always upload all of dist/, not just the one changed file, or everything else 404s. Afterwards, sync the same change back into the git repo so the next CLI/CI deploy doesn't silently revert it.
11
Pipeline Comparison
Pipeline
Auth
Trigger
Best for
A · Wrangler CLI
OAuth login or token
npm run deploy
Day-to-day human deploys default
B · Azure DevOps
API token (secret var)
Merge to main
Team GitOps in the existing ADO org
C · GitHub Actions / native Git
API token / GitHub OAuth
Push to main
GitOps if the repo moves to GitHub
D · Claude / MCP
API token (D1) · OAuth (D2)
Natural-language prompt
Agent-authored docs, autonomous publishing
E · Raw REST API
API token
Any HTTP client
Custom tooling, rollbacks, status checks
F · Web upload
Dashboard login
Drag & drop
Emergency / non-technical fallback
All six publish to the same project — they can be mixed freely. The only coordination rule: keep dist/ in git as the source of truth (see the §10 caveat).
12
Troubleshooting
Symptom
Cause & fix
docs.onalead.com doesn't resolve
GoDaddy CNAME missing or still propagating (TTL 600 ⇒ ≤10 min). Verify with nslookup -type=CNAME docs.onalead.com 8.8.8.8.
Custom domain stuck on initializing / pending
Cloudflare validates over HTTP once the CNAME resolves; allow up to ~1 h. Check Workers & Pages → docs-hub → Custom domains.
TLS certificate error on first visit
Certificate issuance follows domain validation by a few minutes. If >1 h, remove and re-add the custom domain.
308 redirect on .html URLs
Normal — Pages pretty-URL behavior (§03). Both URL forms serve the page.
wrangler: not authenticated
OAuth session expired. Re-run npx wrangler login, or set CLOUDFLARE_API_TOKEN to go tokenized/headless permanently.
CI fails with Authentication error [code 10000]
Token revoked, expired, or missing the Cloudflare Pages · Edit permission. Reissue per §04.
Page 404s after a web upload
Partial upload replaced the bundle (§10). Redeploy the full dist/ from git: npm run deploy.
Wrong content live / bad deploy
Instant rollback: dashboard → Deployments → ⋯ → Rollback to this deployment, or the API call in §09.