If you want your static site to wear a custom domain without paying for hosting or tearing out your hair this guide will show you how to map a GoDaddy domain to GitHub Pages. You get free web hosting and a certificate for HTTPS once the internet finally agrees to update its records. Spoiler alert GitHub Pages is the quiet hero of many side projects and blogs.
Make sure your site branch is published and actually has files to serve. For a user or organization site push to the main branch named after the account. For a project site use the gh-pages branch or the branch set in Pages settings. Push the compiled static site or source that Pages will build so the service has something to look at.
In the repository root add a file named CNAME that contains only the custom domain you want to use. Examples are www.example.com or example.com depending on whether you want the www prefix. Commit and push the file so GitHub Pages knows what domain to expect. Yes this file really matters and no you cannot skip it because magic will not happen.
Log into the GoDaddy DNS manager for your domain and edit the records. What you add depends on whether you want the apex domain or the www hostname to be the main address.
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
Save the changes and then go have a coffee or a small existential crisis while DNS updates. Propagation usually takes minutes to a few hours but sometimes the internet likes to move at snail speed.
After you change DNS check two things. First verify the DNS records with tools such as dig or any online DNS checker. Second open the Pages settings in your repository and look for the green verified check next to the custom domain. If you see a warning read it and then read it again because DNS typos are common and merciless.
Once GitHub validates the domain the Pages settings will offer to provision an HTTPS certificate. Enable the HTTPS option and if you want extra safety check the enforce HTTPS box so all traffic is secure. Certificate provisioning is automatic but may take a few minutes to complete.
There you go you have a mapped domain on GoDaddy serving a GitHub Pages static site with DNS and HTTPS configured. It will probably work on the first try and if it does not you now know where to curse and where to check. Happy deployment and try not to break anything important.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.