How to set up Github Pages with Google domains
You are writing the last line of code on your awesome webpage, now you want the world to see it. Or you are a first time user of Github pages, it can be confusing at first. I read many helpful tutorials that helped me but I just wanted to write my own that hopefully will help someone set up their page too.
First make a Github page
First create a repo just call it whatever you’d like. In this example I called it “awesome-website”. Github has a pretty good page on how to do this, I’d recommend using that tutorial. Once you’ve made your Github page you’ll be ready to set up your Google Domain with Github pages.
Setup Google Domain name
Now, to the reason I wrote this. Go to google domains and buy a domain.
Go back to Github …
Create another file. This is the CNAME file that simply has the domain name. In this case I added the apex name or “whatever.com” and the other is the “www” subdomain added to the root domain which is “whatever.com”.
Note: the apex name is also the root name. It is called other things too.
Then write a commit message and save it. Next look in settings and see that the name is different.
So far your page should look like this. It still needs to be configured in your Google Domains settings.
Note: Once you’ve configured the DNS, the website url will turn green.
Now lets go configure your domain …
In your dashboard click on the third option that says configure DNS and then head over to the “Custom resource records” section.
This is what you want your configuration to look like. Once you add your Github path, as seen in this example (it adds “whatever.com” automatically, this is not seen in this picture).
Wait a second before celebrating: These changes may take a bit longer that you would expect. It can range anywhere from an hour to 48 hours.
Your awesome website has the name you gave it and you can share it with everyone.