Make sure GitHub Pages already works
Before touching the domain, confirm that your GitHub Pages link opens the site correctly.
- If the GitHub link is not working yet, stop here and finish the GitHub guide first.
This guide is mainly about DNS. Keep it simple: point the domain the right way in Cloudflare, then tell GitHub Pages which domain belongs to the site.
Read one step, do that one step, then come back. That is the whole idea here.
Before touching the domain, confirm that your GitHub Pages link opens the site correctly.
Open Cloudflare, sign in, and click the domain you want to use for the website.
Find and click the DNS section for the domain.
If you want the plain root domain to work too, add A records for @ that point to GitHub Pages.
Add a CNAME record where the name is www and the target is your GitHub Pages address.
Double-check the values, then save the records.
Open your GitHub repository again and go back to Settings, then Pages.
In the custom domain box, enter the domain you want attached to the site.
Save the custom domain in GitHub Pages and give it a little time to process.
Give the records a little time. Then test both the root domain and the www version.
When GitHub shows the HTTPS option as available, turn it on.
Visit the domain in your browser and make sure the site loads correctly.