Skip to main content

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.

ItemValue
Sourcedocumentation/
Build outputdocumentation/build/
Pages projectnova-print-docs
Workflow.github/workflows/deploy-documentation.yml
Suggested URLhttps://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​

  1. Merge or push to main.
  2. If files under documentation/** (or the workflow file) changed, Deploy documentation runs.
  3. The job installs Node 22, runs npm ci && npm run build in documentation/, 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.

On the project → Custom domains → add e.g. docs.novaorder.in.

DNS (proxied):

TypeNameTarget
CNAMEdocs on novaorder.innova-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:

SecretPurpose
CLOUDFLARE_API_TOKENToken with Account → Cloudflare Pages → Edit
CLOUDFLARE_ACCOUNT_IDCloudflare 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).

SecretDefault if unsetExample
DOCUSAURUS_URLhttps://docs.novaorder.inhttps://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​

SymptomFix
Workflow does not startChanges must be under documentation/**, or use Run workflow
Wrangler auth errorFix CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID (Pages Edit permission)
Wrong canonical / OG URLsSet DOCUSAURUS_URL and re-run the workflow
Project not foundCreate nova-print-docs exactly as named in the workflow
Broken links fail the buildDocusaurus uses onBrokenLinks: 'throw' — fix links locally with npm run build