Launch a Website with a Custom URL using Github Pages and Google Domains

Connor Leech
May 13, 2017 · 4 min read
https://domains.google/#/

Step 1: Buy your domain at Google Domains

Step 2: Create a Static Website

$ mkdir YOUR_GITHUB_USERNAME.github.io
$ cd YOUR_GITHUB_USERNAME.github.io
$ touch index.html
<!DOCTYPE html>
<html>
<head>
<title>Connor's Website</title>
</head>
<body>

<h1>Hello Internet!</h1>
<p>This is a paragraph.</p>
<script>alert('Random Javascript!');</script>
</body>
</html>
$ git init
$ git add -A
$ git commit -m 'initial commit'
$ git status
On branch master
nothing to commit, working tree clean

Step 3: Create the Repo on Github.com

Click the plus icon in top right and then ‘New Repository’

Public repos are free. Leave the README box unchecked. We can create that later.

Step 4: Link your local code to the github repo

Once the repo is created on github we need to connect it to our local files that we created in Step 2. Get the remote url:

Copy that https link (you can use the button on the right to copy)
$ git remote add origin https://github.com/connor11528/connor11528.github.io.git$ git remote -vorigin https://github.com/connor11528/connor11528.github.io.git (fetch)
origin https://github.com/connor11528/connor11528.github.io.git (push)
$ git push origin masterCounting objects: 58, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (57/57), done.
Writing objects: 100% (58/58), 962.02 KiB | 0 bytes/s, done.
Total 58 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), done.
To https://github.com/connor11528/connor11528.github.io.git
* [new branch] master -> master

Step 5: Add CNAME file

$ touch CNAME
connorleech.info
www.connorleech.info
$ git add -A
$ git commit -m 'add CNAME file'
$ git push origin master

Step 6: Configure DNS for Google Domain

Over at https://domains.google.com/registrar head to the “Configure DNS” tab and scroll to the “Custom resource records” section at the bottom of the page.

Navigate to the Configure DNS tab
Add custom resource records to our configured domain

Employbl

Employbl is a database of active candidates in the Bay Area. I generate leads for talent teams

Connor Leech

Written by

Coder and father. Employbl is a tech recruitment tool for candidates and employers: https://employbl.com/

Employbl

Employbl

Employbl is a database of active candidates in the Bay Area. I generate leads for talent teams