Deploy this documentation site to Cloudflare Pages
The Nova Print docs site lives in the monorepo folder documentation/ (Docusaurus). A push to main that changes that folder builds the static site and publishes it to Cloudflare Pages.
| Item | Value |
|---|---|
| Source | documentation/ |
| Build output | documentation/build/ |
| Pages project | nova-print-docs |
| Workflow | .github/workflows/deploy-documentation.yml |
| Suggested URL | https://docs.novaorder.in (custom domain; also *.pages.dev) |
This is separate from Admin / POS / Checkout Pages projects. Full product hosting map: Deployment Notes and repo file docs/DEPLOYMENT.md.
How push-to-main works
- Merge or push to
main. - If files under
documentation/**(or the workflow file) changed, Deploy documentation runs. - The job installs Node 22, runs
npm ci && npm run buildindocumentation/, then:
wrangler pages deploy documentation/build --project-name=nova-print-docs --commit-dirty=true
You can also start it by hand: GitHub → Actions → Deploy documentation → Run workflow.
Deploys use GitHub Actions + Wrangler, not Cloudflare’s built-in Git integration. Do not enable Cloudflare automatic Git builds for the same repo on this project, or you will get double deploys.
One-time setup
1. Create the Pages project
npx wrangler pages project create nova-print-docs
Or: Cloudflare dashboard → Workers & Pages → Create → Pages.
2. Custom domain (optional but recommended)
On the project → Custom domains → add e.g. docs.novaorder.in.
DNS (proxied):
| Type | Name | Target |
|---|---|---|
| CNAME | docs on novaorder.in | nova-print-docs.pages.dev |
Cloudflare often creates the DNS record when you attach the domain on the project.
3. API token and account ID
Reuse the same secrets already used by Admin / POS / Checkout:
| Secret | Purpose |
|---|---|
CLOUDFLARE_API_TOKEN | Token with Account → Cloudflare Pages → Edit |
CLOUDFLARE_ACCOUNT_ID | Cloudflare account ID |
If you do not have them yet, create a custom API token (Pages Edit) and copy the account ID from the dashboard overview. Details: repo docs/DEPLOYMENT.md § Cloudflare projects and API token.
4. Docs site URL secrets (optional)
Docusaurus bakes url / baseUrl into the build (canonical links, sitemap, OG URLs).
| Secret | Default if unset | Example |
|---|---|---|
DOCUSAURUS_URL | https://docs.novaorder.in | https://docs.novaorder.in |
DOCUSAURUS_BASE_URL | / | / (use /docs-site/ only if you host under a path) |
Set these in Repo → Settings → Secrets and variables → Actions before the first production build if your real host differs from the default.
Day-to-day
Deploy by editing docs
git checkout main
# edit files under documentation/
git add documentation/
git commit -m "Update documentation"
git push origin main
Watch Actions → Deploy documentation. When green, open the custom domain or the deployment URL on the Pages project.
Redeploy without content changes
After changing DOCUSAURUS_URL or Cloudflare credentials: Actions → Deploy documentation → Run workflow.
Local build check
cd documentation
npm ci
npm run build
npm run serve
Output is in documentation/build/.
Verify
curl -sI https://docs.novaorder.in
# or your *.pages.dev hostname
Open a few deep paths (User Guide and Technical) and confirm they load over HTTPS.
Troubleshooting
| Symptom | Fix |
|---|---|
| Workflow does not start | Changes must be under documentation/**, or use Run workflow |
| Wrangler auth error | Fix CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID (Pages Edit permission) |
| Wrong canonical / OG URLs | Set DOCUSAURUS_URL and re-run the workflow |
| Project not found | Create nova-print-docs exactly as named in the workflow |
| Broken links fail the build | Docusaurus uses onBrokenLinks: 'throw' — fix links locally with npm run build |
Related
- Deployment Notes — all production apps
- Local development
- Repo:
docs/DEPLOYMENT.md,docs/CLOUDFLARE_PAGES.md