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

Connor Leech
May 13, 2017 · 4 min read
Image for post
Image for post
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’

Image for post
Image for post
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:

Image for post
Image for post
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.

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

Employbl

Find a tech or startup job in the Bay Area.

Connor Leech

Written by

Engineer, writer and community organizer. I built Employbl to help candidates get jobs in the Bay Area: https://employbl.com/

Employbl

Employbl

Find a tech or startup job in the Bay Area.

Connor Leech

Written by

Engineer, writer and community organizer. I built Employbl to help candidates get jobs in the Bay Area: https://employbl.com/

Employbl

Employbl

Find a tech or startup job in the Bay Area.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store