read

I’ve been hosting my Jekyll sites on GitHub Pages for years. It’s simple and free. But I recently migrated to Cloudflare Pages, and here’s why.

Why Cloudflare Pages?

The main feature that drives my to cloudflare is that I can deploy different branches. eg. I can have a beta branch serving to a beta subdomain for preview.

Other features:

Feature GitHub Pages Cloudflare Pages
CDN Limited Global (300+ cities)
Bandwidth 100GB/month soft limit Unlimited
Build minutes 10 min limit per build 500/month free
Preview deployments Manual setup Automatic per branch
Custom domains 1 per site Unlimited
Edge functions None Workers available
Analytics None Built-in
DDoS protection Basic Enterprise-grade

Migration Steps

  1. Create account at pages.cloudflare.com
  2. Workers & PagesCreatePages tab → Connect to Git
  3. Select repo, set branch to main, build command bundle exec jekyll build, output _site
  4. Deploy and verify at your-project.pages.dev
  5. Add custom domain in project settings
  6. Update DNS to point to your domain eg. samwize.com (auto if already on Cloudflare)
  7. Disable GitHub Pages in repo settings

Disable GitHub Pages

Once confirmed working:

  1. Go to your GitHub repo → Settings → Pages
  2. Set source to None

That’s it. Your site is now on Cloudflare Pages.

If something goes wrong, rolling back is straightforward:

  1. Re-enable GitHub Pages in repo settings selecting back the branch
  2. Update DNS to point back to your-username.github.io with the github IPs
  3. Remove custom domain from Cloudflare Pages

Image

@samwize

¯\_(ツ)_/¯

Back to Home