Cloudflare Setup Checklist for Docs Subdomain
Complete this checklist to set up the documentation subdomain deployment using Cloudflare's automatic Git integration (same method as your main app).
Prerequisites
- [ ] Cloudflare account with
ourlantern.appdomain - [ ] Admin access to
cattreedev/lantern_appGitHub repository - [ ] 10 minutes of time
No API tokens or GitHub secrets needed! This uses the same automatic Git integration as your main app deployment.
Step 1: Create Production Docs Project
- Go to Cloudflare Dashboard
- Navigate to Workers & Pages → Pages
- Click Create a project
- Click Connect to Git
- Select your GitHub account and repository:
cattreedev/lantern_app - Configure the project:
- Project name:
lantern-docs - Production branch:
main - Build command:
npm run docs:build - Build output directory:
docs/.vitepress/dist - Root directory: (leave empty)
- Project name:
- Click Save and Deploy
Checkpoint: ✅ Production project created and connected to GitHub
Step 2: Create Development Docs Project
- Go back to Workers & Pages → Pages
- Click Create a project again
- Click Connect to Git
- Select the same repository:
cattreedev/lantern_app - Configure the project:
- Project name:
lantern-docs-dev - Production branch:
dev⚠️ (NOT main!) - Build command:
npm run docs:build - Build output directory:
docs/.vitepress/dist - Root directory: (leave empty)
- Project name:
- Click Save and Deploy
Checkpoint: ✅ Development project created
Step 3: Add Custom Domains
Production Domain
- Open the
lantern-docsproject - Go to Settings tab
- Click Domains & accounts in the sidebar
- Click Set up a custom domain
- Enter:
docs.ourlantern.app - Click Continue
- Cloudflare will automatically create DNS records
Checkpoint: ✅ docs.ourlantern.app domain configured
Development Domain
- Open the
lantern-docs-devproject - Go to Settings tab
- Click Domains & accounts
- Click Set up a custom domain
- Enter:
docs.dev.ourlantern.app - Click Continue
Checkpoint: ✅ docs.dev.ourlantern.app domain configured
Step 4: Verify DNS Records
- Go to Cloudflare Dashboard → Select your
ourlantern.appzone - Click DNS → Records
- Verify these CNAME records exist (Cloudflare created them automatically):
Type Name Target Proxy Status
CNAME docs lantern-docs.pages.dev Proxied (orange)
CNAME docs lantern-docs-dev.pages.dev Proxied (orange) [Note: should be "docs.dev"]Note: The second record should have name "docs.dev" not "docs-dev". The domain setup in Step 3 handles this correctly.
Checkpoint: ✅ DNS records verified
Step 5: Test the Deployment
Test Dev Deployment
- Make a small change to any file in
docs/(e.g., add a space to a markdown file) - Commit and push to
devbranch:bashgit add docs/ git commit -m "test: Trigger docs deployment" git push origin dev - Go to Cloudflare Dashboard → Pages →
lantern-docs-dev - Watch the Deployments tab (should start building within seconds)
- After ~2-3 minutes, visit
https://docs.dev.ourlantern.app
Expected result: Docs site loads successfully
Checkpoint: ✅ Dev deployment working
Test Production Deployment
- Merge your changes to
main:bashgit checkout main git merge dev git push origin main - Watch Cloudflare Dashboard → Pages →
lantern-docs - Visit
https://docs.ourlantern.app
Expected result: Production docs site loads
Checkpoint: ✅ Production deployment working
How It Works
Automatic Deployment:
- Cloudflare monitors your GitHub repository
- When you push to
mainordev, Cloudflare automatically:- Detects the push
- Runs
npm run docs:build - Deploys the built files to the appropriate subdomain
- Updates the site in ~2-3 minutes
No manual steps needed! It works exactly like your main app deployment at ourlantern.app and dev.ourlantern.app.
Troubleshooting
Build Fails
Problem: Deployment fails in Cloudflare
Solution:
- Check Cloudflare Pages deployment logs
- Common issues:
- Node version mismatch (should auto-detect from package.json)
- Missing dependencies (should auto-install)
- Build output directory incorrect (should be
docs/.vitepress/dist)
DNS Not Resolving
Problem: docs.ourlantern.app shows "This site can't be reached"
Solution:
- Check DNS records in Cloudflare dashboard
- Ensure CNAME is proxied (orange cloud)
- Wait 5 minutes for propagation
- Try
nslookup docs.ourlantern.app
Changes Not Appearing
Problem: Pushed changes but site looks the same
Solution:
- Hard refresh browser (Ctrl+Shift+R or Cmd+Shift+R)
- Check Cloudflare Pages to ensure deployment succeeded
- Verify you pushed to the correct branch (dev vs main)
Wrong Environment Deployed
Problem: docs.dev.ourlantern.app shows production content
Solution:
- Verify
lantern-docs-devproject is connected todevbranch - Check Pages project settings in Cloudflare
- Ensure you pushed to
devbranch, notmain
Success Criteria
You're done when all these are true:
- ✅
lantern-docsCloudflare Pages project exists - ✅
lantern-docs-devCloudflare Pages project exists - ✅ Both projects are connected to GitHub (automatic Git integration)
- ✅
docs.ourlantern.appdomain is configured and working - ✅
docs.dev.ourlantern.appdomain is configured and working - ✅ Pushing to
devauto-deploys to dev subdomain - ✅ Pushing to
mainauto-deploys to production subdomain - ✅ Documentation site is accessible at both URLs
What Happens Now?
On every push to dev:
- Cloudflare automatically builds and deploys to
docs.dev.ourlantern.appin ~2-3 min - No manual steps required
On every push to main:
- Cloudflare automatically builds and deploys to
docs.ourlantern.appin ~2-3 min - No manual steps required
On pull requests:
- Cloudflare creates preview deployments automatically
- Preview URL appears in the PR (e.g.,
abc123.lantern-docs-dev.pages.dev) - Test docs changes before merging
It's completely automatic, just like your main app!
Related Documentation
- QUICK_START_DOCS.md — Quick 10-minute setup guide
- DOCS_DEPLOYMENT.md — Technical deployment details
- DEPLOYMENT.md — Main app deployment guide
Last updated: 2026-01-10