|
1 | | -# Cloudflare Pages setup for awac.ganemo.com |
| 1 | +# Cloudflare Pages — awac.ganemo.com |
2 | 2 |
|
3 | | -Cloudflare's Pages API requires an Account-scoped token; the current token |
4 | | -in `~/.devvault/providers/cloudflare.yml` is Zone-scoped only. Do these |
5 | | -5 clicks in the Cloudflare dashboard, then the site is live. |
| 3 | +The site is deployed at <https://awac.ganemo.com> via Cloudflare Pages |
| 4 | +(project name: `awac-docs`). |
6 | 5 |
|
7 | | -## Steps |
| 6 | +## Status |
8 | 7 |
|
9 | | -1. **Sign in** to <https://dash.cloudflare.com> with the Ganemo account. |
10 | | -2. **Workers & Pages** → **Create application** → **Pages** → **Connect to Git**. |
11 | | -3. Authenticate against `getGanemo` GitHub org. Select **`awac-docs`** repository (the one without `-oss` — see governance note below). |
12 | | -4. Configure the build: |
13 | | - - **Project name**: `awac-docs` |
14 | | - - **Production branch**: `main` |
15 | | - - **Framework preset**: Astro |
16 | | - - **Build command**: `npm run build` |
17 | | - - **Output directory**: `dist` |
18 | | - - **Node version**: `20` |
19 | | -5. **Save and Deploy**. |
| 8 | +- **Project**: `awac-docs` |
| 9 | +- **Subdomain**: `awac-docs.pages.dev` |
| 10 | +- **Custom domain**: `awac.ganemo.com` (active, status verified, CA: Google Trust Services) |
| 11 | +- **DNS**: CNAME `awac.ganemo.com → awac-docs.pages.dev` in zone `ganemo.com`, proxied through Cloudflare. |
| 12 | +- **SSL**: Universal TLS issued automatically by Cloudflare. |
20 | 13 |
|
21 | | -When the first build completes, Pages assigns the project a URL like |
22 | | -`awac-docs-<hash>.pages.dev`. Note that URL. |
| 14 | +## Deploy mode: Direct Upload + GitHub Action |
23 | 15 |
|
24 | | -## Custom domain |
| 16 | +Pages projects can be either GitHub-connected (OAuth) or Direct Upload. |
| 17 | +This project uses **Direct Upload** with a GitHub Action that runs |
| 18 | +`wrangler pages deploy dist --project-name=awac-docs` on push to `main`. |
25 | 19 |
|
26 | | -In the Pages project → **Custom domains** → **Set up a custom domain**: |
| 20 | +### Required GitHub secrets (set once) |
27 | 21 |
|
28 | | -- Domain: `awac.ganemo.com` |
29 | | -- Click **Activate domain**. |
| 22 | +The `Deploy to Cloudflare Pages` workflow at `.github/workflows/deploy.yml` |
| 23 | +needs two secrets: |
30 | 24 |
|
31 | | -Cloudflare creates the necessary DNS record automatically (CNAME from |
32 | | -`awac` in zone `ganemo.com` to the `*.pages.dev` URL). It also issues a |
33 | | -Universal SSL certificate. |
| 25 | +- `CLOUDFLARE_API_TOKEN` — token with `Account.Cloudflare Pages:Edit` |
| 26 | + scope. Reuse the existing `api_token_pages` from |
| 27 | + `~/.devvault/providers/cloudflare.yml` or create a new one in |
| 28 | + the CF dashboard → My Profile → API Tokens. |
| 29 | +- `CLOUDFLARE_ACCOUNT_ID` — `0a0bbf33ec9e54b7ebcccc08af6bcb35`. |
34 | 30 |
|
35 | | -Verify in 2-5 minutes: |
| 31 | +```bash |
| 32 | +gh secret set CLOUDFLARE_API_TOKEN --repo getGanemo/awac-docs --body "<token>" |
| 33 | +gh secret set CLOUDFLARE_ACCOUNT_ID --repo getGanemo/awac-docs --body "0a0bbf33ec9e54b7ebcccc08af6bcb35" |
| 34 | +``` |
| 35 | + |
| 36 | +After secrets are set, every push to `main` triggers the workflow, |
| 37 | +builds Astro Starlight, and uploads `dist/` to Pages. New version goes |
| 38 | +live within 1-2 minutes. |
| 39 | + |
| 40 | +## Manual deploy (escape hatch) |
| 41 | + |
| 42 | +If the workflow fails or you want to deploy from local: |
36 | 43 |
|
37 | 44 | ```bash |
38 | | -curl -sI https://awac.ganemo.com | head -5 |
39 | | -# Expect: HTTP/2 200, server: cloudflare |
| 45 | +export CLOUDFLARE_API_TOKEN="cfut_..." |
| 46 | +export CLOUDFLARE_ACCOUNT_ID="0a0bbf33ec9e54b7ebcccc08af6bcb35" |
| 47 | +npm install |
| 48 | +npm run build |
| 49 | +npx wrangler pages deploy dist --project-name=awac-docs --branch=main |
40 | 50 | ``` |
41 | 51 |
|
42 | | -## Why awac-docs and not awac-docs-oss? |
| 52 | +## Verify |
| 53 | + |
| 54 | +```bash |
| 55 | +curl -sI https://awac.ganemo.com | head -5 |
| 56 | +# Expect: HTTP/1.1 200 OK, server: cloudflare |
| 57 | +``` |
43 | 58 |
|
44 | | -Per `governance/product-structure.md`, repos prefixed with `docs-` are |
45 | | -internal knowledge documentation. The AWaC public docs site is a |
46 | | -discrete project — it gets its own canonical name, not the `docs-` |
47 | | -prefix. The `-oss` sufix is reserved for the public OSS-counterparts |
48 | | -of repos that have private internal counterparts. AWaC docs has no |
49 | | -private internal counterpart (the canonical doc lives in the same |
50 | | -repo), so no suffix is needed. |
| 59 | +## Why Direct Upload + Action and not GitHub-connected? |
51 | 60 |
|
52 | | -This is documented in the governance doc under "naming exceptions for |
53 | | -OSS docs sites". |
| 61 | +Cloudflare Pages' GitHub Connected mode requires an OAuth grant that |
| 62 | +can only be done in the browser dashboard. Direct Upload + Action gives |
| 63 | +the same outcome (auto-deploy on push) without an OAuth step. |
0 commit comments