Skip to content

Commit 0131cc4

Browse files
Ganemo DevBotclaude
andcommitted
ci: add Cloudflare Pages deploy workflow + update setup docs
Site is live at https://awac.ganemo.com (deployed via wrangler). GitHub Action handles auto-deploys on push to main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fb98e1c commit 0131cc4

3 files changed

Lines changed: 84 additions & 38 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
deployments: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install
25+
run: npm ci
26+
27+
- name: Build
28+
run: npm run build
29+
30+
- name: Deploy to Cloudflare Pages
31+
uses: cloudflare/wrangler-action@v3
32+
with:
33+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
34+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
35+
command: pages deploy dist --project-name=awac-docs --branch=main

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/setup-cloudflare-pages.md

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,63 @@
1-
# Cloudflare Pages setup for awac.ganemo.com
1+
# Cloudflare Pages awac.ganemo.com
22

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`).
65

7-
## Steps
6+
## Status
87

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.
2013

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
2315

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`.
2519

26-
In the Pages project → **Custom domains****Set up a custom domain**:
20+
### Required GitHub secrets (set once)
2721

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:
3024

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`.
3430

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:
3643

3744
```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
4050
```
4151

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+
```
4358

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?
5160

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

Comments
 (0)