Branching and CI for this site
The documentation repo follows the same branch and deployment model as the frontend apps: develop is the integration branch and deploys to a dev URL on every push; main deploys to production.
| Branch | Workflow | Cloudflare Pages branch | URL |
|---|---|---|---|
develop | .github/workflows/deploy-develop.yml | develop (preview) | https://docs-dev.everymanawarrior.cc |
main | .github/workflows/deploy-production.yml | main (production) | https://docs.everymanawarrior.cc |
| pull requests | .github/workflows/ci.yml | none | build and typecheck only |
Pages project: emaw-documentation. Output directory: build/.
Day-to-day flow
- Branch from
develop(feature/<topic>ordocs/<topic>). - Edit pages under
docs/, runnpm run buildlocally. The build fails on broken internal links. - Open a pull request into
develop. The CI workflow builds it. - Merge. The Deploy develop workflow publishes to docs-dev within a couple of minutes.
- When the dev site looks right, open a pull request from
developintomain. Merging deploys production.
For a typo or a small wording fix, the Edit this page link at the bottom of every page opens the file on GitHub. Commit to a new branch and open the pull request from there.
What the workflows do
Each deploy workflow runs on ubuntu-latest with Node 24:
- run: npm ci
- run: npm run typecheck
- run: npm run build
- run: npx wrangler@4 pages deploy build --project-name emaw-documentation --branch develop
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
The develop build sets DOCS_URL=https://docs-dev.everymanawarrior.cc so Docusaurus bakes the right canonical URL and sitemap; production uses the default in docusaurus.config.ts.
Deploys are done with Wrangler from the workflow rather than Cloudflare's own Git integration, which keeps every frontend on one mechanism and lets the build run with the repo's Node version.
One-time setup (done in the Cloudflare and GitHub dashboards)
These steps cannot be done from the repository. Ask the Cloudflare account owner (see who to ask).
1. Cloudflare Pages project
- Cloudflare dashboard → Workers & Pages → Create → Pages → Direct Upload (not Git).
- Project name
emaw-documentation. Production branchmain. - The first deploy can be an empty upload; the workflows take over from there.
2. Custom domains
In the project → Custom domains:
docs.everymanawarrior.cc→ productiondocs-dev.everymanawarrior.cc→ thedevelopbranch preview
Cloudflare creates the DNS records in the everymanawarrior.cc zone automatically.
3. Cloudflare Access
The docs are internal. In Zero Trust → Access → Applications → Add an application → Self-hosted:
- Application domain:
docs.everymanawarrior.ccanddocs-dev.everymanawarrior.cc(two applications, or one with both domains). - Identity provider: the existing Google Workspace login.
- Policy: Allow when Emails ending in
@everymanawarrior.com. - Session duration: match the admin app.
Also protect the raw *.emaw-documentation.pages.dev preview hostnames or disable preview access in the Pages project so the site cannot be reached around Access.
4. API token and GitHub secrets
- Cloudflare → My Profile → API Tokens → create a token with Cloudflare Pages: Edit on the account (reuse the token the other frontends use if your policy allows).
- GitHub repo → Settings → Environments: create
developandproduction. Onproduction, restrict deployment branches tomain. - Add
CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDas environment secrets on both.
5. Verify
Push to develop, watch Actions, then open https://docs-dev.everymanawarrior.cc. You should be asked to sign in with Google before the site loads.
Manual deploy
If Actions is unavailable:
npx wrangler login
npm run build
npx wrangler pages deploy build --project-name emaw-documentation --branch develop
Use --branch main for production. Set DOCS_URL before npm run build when deploying develop by hand.