Deploy to Cloudflare Pages
About 268 wordsLess than 1 minute
2026-08-31
Cloudflare Pages provides global CDN acceleration, free SSL certificates, and unlimited bandwidth for personal blogs.
Prerequisites
- Code hosted on GitHub or GitLab
- A Cloudflare account
siteconfigured insrc/config/siteConfig.tswith your official domain
Important
Mandatory Node.js Version Variable Cloudflare Pages build runners default to an older Node.js runtime. You must specify NODE_VERSION = 22 in project Environment variables to meet engine requirements.
Method 1: Git Integration
In the Cloudflare Dashboard, navigate to Workers & Pages → Create → Pages → Connect to Git.
Select your Git provider, authorize Cloudflare, and choose your Shirone repository.
Configure build settings:
Setting Value Project name Your project name (determines <name>.pages.dev)Production branch mainBuild command pnpm buildBuild output directory distUnder Environment variables, add
NODE_VERSION = 22to satisfy Node.js ≥ 22.12 requirements.Important: The default Node.js version in Cloudflare build images is older than 22. Adding this variable is required.
Click Save and Deploy.
Method 2: Wrangler CLI
pnpm add -g wrangler
# Build locally
pnpm install
pnpm build
# Deploy output directory
wrangler pages deploy dist --project-name=<your-project-name>Custom Domains
- Go to your Pages project in Cloudflare Dashboard and select Custom domains → Set up a custom domain.
- If your DNS is managed on Cloudflare, DNS records and SSL are configured automatically.
- If DNS is hosted externally, add a
CNAMEpointing to<project>.pages.dev.
Troubleshooting
Build Error: Node Version Unsupported
Ensure NODE_VERSION is set to 22 in project Environment variables (under Settings → Environment variables).
Copyright
Copyright Ownership:matsuzaka-yuki
License under:Attribution 4.0 International (CC-BY-4.0)