๐ Quick Start: Deploy Docs to Subdomain โ
Goal: Get documentation deployed to docs.ourlantern.app and docs.dev.ourlantern.app
Time: ~10 minutes
Method: Cloudflare Pages automatic Git integration (same as main app deployment)
Why No API Keys Needed? โ
Just like how you set up ourlantern.app and dev.ourlantern.app, the docs use Cloudflare's automatic Git integration. You connect your repo once in the Cloudflare dashboard, and it automatically deploys on every push. No GitHub Actions, no API tokens, no secrets needed!
Step 1: Create Production Docs Project (3 min) โ
- Go to Cloudflare Dashboard
- Click Workers & Pages โ Pages โ Create a project
- Click Connect to Git
- Select
cattreedev/lantern_app(same repo as your main app) - Fill in:
Project name: lantern-docs Production branch: main Build command: npm run docs:build Build output dir: docs/.vitepress/dist - Click Save and Deploy
โ
Checkpoint: Project lantern-docs created
Step 2: Create Development Docs Project (3 min) โ
- Click Create a project again
- Click Connect to Git
- Select same repo
cattreedev/lantern_app - Fill in:
Project name: lantern-docs-dev Production branch: dev โ IMPORTANT: dev not main! Build command: npm run docs:build Build output dir: docs/.vitepress/dist - Click Save and Deploy
โ
Checkpoint: Project lantern-docs-dev created
Step 3: Add Custom Domains (4 min) โ
For lantern-docs (production) โ
- Open
lantern-docsproject in Cloudflare - Go to Settings โ Domains & accounts
- Click Set up a custom domain
- Enter:
docs.ourlantern.app - Click Continue
- Cloudflare auto-creates DNS records
For lantern-docs-dev (development) โ
- Open
lantern-docs-devproject - Go to Settings โ Domains & accounts
- Click Set up a custom domain
- Enter:
docs.dev.ourlantern.app - Click Continue
- Cloudflare auto-creates DNS records
โ Checkpoint: Both domains configured
Done! ๐ โ
Your documentation is now set up for automatic deployment!
What Happens Now? โ
Every time you push to dev:
- Cloudflare automatically detects the push
- Builds docs with
npm run docs:build - Deploys to
docs.dev.ourlantern.appin ~2-3 minutes
Every time you push to main:
- Same automatic process
- Deploys to
docs.ourlantern.appin ~2-3 minutes
Every time you open a PR:
- Cloudflare creates a preview deployment
- Preview URL appears in the PR (like
abc123.lantern-docs-dev.pages.dev)
It works exactly like your main app deployment! No manual steps, no API keys, completely automatic.
Verify It's Working โ
Make a small change to any doc file:
bashecho "\nTest update" >> docs/README.md git add docs/README.md git commit -m "test: Trigger docs deployment" git push origin devGo to Cloudflare Dashboard โ Pages โ
lantern-docs-devWatch the deployment in the Deployments tab (~2-3 min)
Visit
https://docs.dev.ourlantern.appHard refresh (Ctrl+Shift+R) to see your changes
โ Success! Your docs are now auto-deploying.
Troubleshooting โ
Build fails โ
โ Check Cloudflare Pages deployment logs in the dashboard
โ Common issue: Node version (should auto-detect Node 20 from package.json)
Docs don't update โ
โ Hard refresh browser (Ctrl+Shift+R or Cmd+Shift+R)
โ Check deployment succeeded in Cloudflare dashboard
Domain not resolving โ
โ Wait 5 minutes for DNS propagation
โ Check DNS records in Cloudflare dashboard
Next Steps โ
- Test it - Push a small change to dev and watch it deploy
- Verify - Visit
docs.dev.ourlantern.appand see your changes - Deploy to prod - Merge to main when ready
Questions? See CLOUDFLARE_DOCS_SETUP.md for detailed instructions.