A scaffold project for hosting mdBook on Cloudflare Workers with OIDC authentication. Only authenticated users can access your documentation.
git clone https://github.com/KEY60228/cloudflare-mdbook-hono.git
cd cloudflare-mdbook-hono
npm installUpdate the CALLBACK_URL in wrangler.jsonc to match your Worker URL:
Configure your OIDC provider credentials:
npx wrangler secret put ISSUER
# Enter your OIDC issuer URL (e.g., https://accounts.google.com)
npx wrangler secret put CLIENT_ID
# Enter your OIDC client IDAdd the following secrets to your GitHub repository (Settings > Secrets and variables > Actions):
| Secret | Description |
|---|---|
CLOUDFLARE_API_TOKEN |
Cloudflare API token with Workers edit permission |
CLOUDFLARE_ACCOUNT_ID |
Your Cloudflare account ID |
Edit the mdBook source files in mdbook/src/:
SUMMARY.md- Table of contentschapter_1.md- Your content (add more chapters as needed)
Refer to the mdBook documentation for more details.
cd mdbook && mdbook build && cd ..
npm run deployPush to the main branch to trigger automatic deployment via GitHub Actions.
{ "vars": { "CALLBACK_URL": "https://your-worker-name.your-subdomain.workers.dev/auth/callback" } }