Saturday, October 19, 2024
Congrats! You’ve finally bought yourself a domain, and now you're ready to connect it to your GitHub Pages website. This guide will walk you through the steps to set up your GoDaddy domain with GitHub Pages.
First, ensure that your repository name follows the required naming convention for GitHub Pages ie, your repository name must be your-username.github.io.
mine is: https://github.com/abhi-xyz/abhi-xyz.github.io
Once your repository is ready, navigate to the repository’s Settings.
Now that your GitHub Pages site is live, the next step is to point your custom GoDaddy domain to GitHub Pages.
(Repeat this for all four IPs: 185.199.108.153, 185.199.109.153, 185.199.110.153, 185.199.111.153)
Save the changes.
Once you’ve set up the DNS records in GoDaddy, go back to your GitHub repository.
Head to Settings > Pages.
Scroll down to the Custom Domain section.
Enter your GoDaddy domain (e.g., yourdomain.com) in the field. GitHub will automatically create a CNAME file in the root directory of your repository. This file tells GitHub that your website is linked to this custom domain.
After adding the domain, GitHub Pages will take a few minutes to process the changes.
After configuring your custom domain, it's crucial to ensure that your website is served securely over HTTPS. GitHub Pages offers built-in support for HTTPS through Let's Encrypt, which is a major advantage over traditional domain providers like GoDaddy.
However, after adding your domain, you may encounter a message saying, "TLS certificate is being provisioned". This is completely normal and indicates that GitHub is working with Let's Encrypt to issue your SSL certificate. You may need to refresh the page after some time if the Enforce HTTPS option is disabled at first.
Normally, domains purchased from GoDaddy or other providers are routed through HTTP by default, which means your site won't be secure. When someone visits your site, their browser will display a warning indicating that the site is not secure, which can drive away visitors.
If you were to purchase a SSL certificate from GoDaddy, it could cost you approximately ₹4999 annually. However, by using GitHub Pages, you get a free TLS certificate through Let's Encrypt, giving you secure, encrypted access to your website without additional costs. This is one of the key benefits of using GitHub Pages for hosting!
Once the DNS settings propagate (which may take between 24-48 hours), your GitHub Pages site will be securely accessible through your custom GoDaddy domain over HTTPS.
That’s it! You've successfully set up your GoDaddy domain with GitHub Pages. 🎉 Enjoy your new, secure website!