Custom domain on Google domain

Published

Thu, 12 of September, 2024

Modified

Thu, 12 of September, 2024

The following steps help when setting up a new website that is hosted on GitHub Pages. Then, since GitHub Pages supports using custom domains, there are the instructions to re-direct tje site’s URL from the default <user>.github.io/domain to a custom domain name registered on Google Domain. Since GitHub Pages supports using custom domains, there are the instructions to re-direct the site’s URL from the default <user>.github.io/domain to a custom domain name registered on Google Domain.

Assuming you have:

  1. An Google Domain account
  2. A GITHUB account
  3. A website (distill/blogdown/quarto) in a GH repo that is being already deployed using GH PAGES on a domain like gh_user.github.io/domain_name/ (in my case https://lulliter.github.io/domain_name/)

KEY Google Domain INFO: Domain & Hosted ZOne

INSTRUCTIONS for website {Github Pages + Google Domain}

[on GitHub]: initiate a repo in the usual way

  1. Create a new repo on GitHub
  2. Go on local PARENT directory of the intended repo
  3. Execute
git clone https://github.com/Lulliter/example.git
  1. on Local/GitHub: deploy website via Github Pages

    • add content
    • git add/commit/push (or see my ./_render-deploy.sh)
  2. Configure the Repo to publish on https://lulliter.github.io/example/ by going to Settings –> Pages –> (make sure to have a ./docs folder and indicate to GH that you will deploy from it)

  3. on local: CNAME Looking forward, we will need to have a file named CNAME that contains a single row: your custom domain (in this case: thepadrinoz.com)

❗ Before adding/committing to repo CNAME, at every push, the custom domain gets decoupled from GH Pages settings ….

[on Google Domain] Buy a domain

[on Google Domain] set up a “HOSTED ZONE”