Documentation Deployment¶
This guide explains how to set up and deploy the Freeze Design documentation to Cloudflare Pages.
Overview¶
The documentation is automatically built and deployed via GitHub Actions:
| Component | URL Path | Source |
|---|---|---|
| Developer Docs | / |
mkdocs-material |
| API Reference | /api/ |
Swagger UI (OpenAPI) |
| Component Library | /storybook/ |
Storybook |
| TypeScript Docs | /typescript/ |
TypeDoc |
Production URL: freezedesign-docs.pages.dev
Cloudflare Pages Setup¶
Step 1: Create Cloudflare Account¶
- Sign up at cloudflare.com
- Navigate to Workers & Pages in the dashboard
Step 2: Create Pages Project¶
- Go to Workers & Pages → Create → Pages
- Select Direct Upload (we deploy via GitHub Actions)
- Name the project:
freezedesign-docs - Click Create project
Step 3: Get API Credentials¶
Account ID:
- Go to any domain or the main dashboard
- Find Account ID in the right sidebar
- Copy this value
API Token:
- Go to My Profile → API Tokens
- Click Create Token
- Use the Edit Cloudflare Workers template
- Or create custom token with permissions:
- Account: Cloudflare Pages - Edit
- Zone: (none needed for Pages)
- Copy the generated token
Step 4: Add GitHub Secrets¶
In your GitHub repository:
- Go to Settings → Secrets and variables → Actions
- Add these secrets:
| Secret Name | Value |
|---|---|
CLOUDFLARE_ACCOUNT_ID |
Your account ID |
CLOUDFLARE_API_TOKEN |
Your API token |
Step 5: Trigger Deployment¶
Push to the main branch or manually trigger the workflow:
Workflow Details¶
The deployment workflow (.github/workflows/docs.yml) runs:
- Build jobs (parallel):
build-mkdocs- Developer documentationbuild-openapi- API reference from Djangobuild-storybook- React component library-
build-typedoc- TypeScript API documentation -
Combine - Merges all outputs into single site
-
Deploy - Pushes to Cloudflare Pages
Preview Deployments¶
Pull requests automatically get preview deployments:
- URL format:
https://<branch-name>.freezedesign-docs.pages.dev - A comment is added to the PR with the preview URL
Local Development¶
Build Documentation Locally¶
# MkDocs (developer docs)
cd docs
pip install -r requirements.txt
mkdocs serve # http://localhost:8000
# Storybook
cd frontend
npm install
npm run storybook # http://localhost:6006
# TypeDoc
cd frontend
npm run docs:typedoc
# Output in frontend/typedoc-out/
Build All Documentation¶
# MkDocs
mkdocs build --config-file docs/mkdocs.yml --site-dir site
# Storybook
cd frontend && npm run build-storybook
# TypeDoc
cd frontend && npm run docs:typedoc
Custom Domain (Optional)¶
To use a custom domain like docs.freezedesign.nl:
- Go to Cloudflare Pages → your project → Custom domains
- Click Set up a custom domain
- Enter your domain (e.g.,
docs.freezedesign.nl) - Add the DNS record as instructed
- Wait for SSL certificate provisioning
Troubleshooting¶
Build Failures¶
Check the GitHub Actions logs:
Missing Secrets¶
If deployment fails with authentication errors:
- Verify secrets are set in GitHub
- Check API token has correct permissions
- Ensure account ID is correct
Storybook Build Issues¶
If Storybook fails to build: