Cloudflare Pages Deployment
This document describes how to deploy OpenHuman to Cloudflare Pages.
Prerequisites
- Cloudflare account
- GitHub repository
- Domain name (optional)
Deployment Steps
1. Connect GitHub
- Log in to Cloudflare Dashboard
- Go to Workers & Pages
- Click Create application
- Select Pages → Connect to Git
2. Configure Build
| Setting | Value |
|---|---|
| Production branch | main |
| Build command | npm run build |
| Build output directory | build |
3. Environment Variables
Add in Pages settings:
NODE_VERSION = 18
4. Custom Domain
- Go to Custom domains
- Click Add custom domain
- Enter your domain name
- Configure DNS (CNAME or A record)
Deployment Configuration
Configure in docusaurus.config.ts:
const config: Config = {
url: 'https://openhumanwiki.com',
baseUrl: '/',
organizationName: 'bigwei08028',
projectName: 'openhumanwiki',
};
Deploy Using Wrangler
npm install -g wrangler
wrangler pages deploy build --project-name=openhumanwiki
Continuous Deployment
Every time you push to the main branch, Cloudflare Pages will automatically:
- Pull the latest code
- Run the build
- Deploy to global CDN
Common Issues
Build Failed
Check if the build command in package.json is correct.
Domain Verification Failed
Ensure DNS records have propagated (wait 24-48 hours).
Cache Issues
Clear cache in Cloudflare Dashboard.
Next Steps
- Docker Deployment - Deploy using Docker
- Vercel Deployment - Deploy using Vercel