Skip to main content

Deploying a Static Site with Both GitHub Pages and Cloudflare Pages

·175 words·1 min·
soloopooo
Author
soloopooo
What about you?

This blog is currently deployed to both Pages. See Cloudflare Pages, Github Pages

For well-known reasons, Cloudflare Pages can often be faster than GitHub Pages, thanks to Cloudflare’s global CDN network (except for some regions).

Thanks to the Pages feature in the Cloudflare dashboard, it’s easy to deploy an existing repository.

The source repository for this blog is here:

Publishing to GitHub Pages and Cloudflare Pages is very simple:

With powerful and free GitHub Actions, you can use the official Actions to build to the GitHub Pages environment. Similarly, Cloudflare can perform automatic builds and will automatically rebuild and publish to Cloudflare’s global network whenever the git repository is updated.

Cloudflare Pages build page
Cloudflare Pages build page

Readers can write Workflows according to their static site’s build environment; once written, they will automatically build and publish to Pages.

Note! Please ensure that the custom domains for GitHub Pages and Cloudflare Pages are different.

Note! Because Cloudflare Pages’ default top-level domain pages.dev can be affected by SNI blocking, be sure to add a custom domain.