Skip to main content

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

  1. Log in to Cloudflare Dashboard
  2. Go to Workers & Pages
  3. Click Create application
  4. Select PagesConnect to Git

2. Configure Build

SettingValue
Production branchmain
Build commandnpm run build
Build output directorybuild

3. Environment Variables

Add in Pages settings:

NODE_VERSION = 18

4. Custom Domain

  1. Go to Custom domains
  2. Click Add custom domain
  3. Enter your domain name
  4. 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:

  1. Pull the latest code
  2. Run the build
  3. 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