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