GitHub Pages + CloudFlare is one of the easiest ways to set up a website.
I’ve done this a few times recently, so I put together a checklist below of things not to forget.
This is not intended as a complete guide, but please let me know if I missed something.
- Add Cloudflare nameservers aida.ns.cloudflare.com and plato.ns.cloudflare.com:
GitHub settings for repo
- Set the branch and directory you want to use for the GitHub Pages site. Note that you don’t have to use a gh-pages branch:
- Set the custom domain for the site:
- Add a plain text file named CNAME to the GitHub Pages branch/directory you specified in the repo settings (see above). This file should only contain your custom domain:
- From the Cloudflare DNS settings for your site, add A records pointing to GitHub (22.214.171.124, 126.96.36.199, 188.8.131.52 and 184.108.40.206). This works for any apex domain (such as example.com):
- You might also want to specify that www URLs redirect:
- From the Crypto page, change settings to always use HTTPS:
- Add a page rule to always use HTTPS: