Core Interaction Spring 2018 โ†‘

We can connect our blogs websites to a new domain using github and a few special settings / files. Will we do this by creating a new github repo for your final project / blog inside of our preexisting git repo ๐Ÿคฏ and then connecting that domain to your github using a CNAME file.

Step 1: Create A New Repo

First create a new repo (without a README!) on github. Name it appropriately (e.g: โ€˜ci-studioโ€™, or โ€˜whatever-your-theme-isโ€™).

Alright, back to your local files. Your class folder structure should look something like this:

๐Ÿ“‚ site/
โ”‚
โ”œโ”€ ๐Ÿ“„ index.html 
โ”œโ”€ ๐ŸŒธ favicon.ico 
โ”‚
โ”œโ”€ ๐Ÿ“‚ assets/
โ”‚  โ”œโ”€ ๐Ÿ“ css/
โ”‚  โ””โ”€ ๐Ÿ“ js/
โ”‚
โ”œโ”€ ๐Ÿ“‚ studio/
โ”‚  โ”œโ”€ ๐Ÿ“ week-01/
โ”‚  โ””โ”€ etc...
โ”‚
โ””โ”€ ๐Ÿ“‚ lab/ 
   โ”œโ”€ ๐Ÿ“ 01_project-name/
   โ””โ”€ etc...

Navigate to your core-interaction studio folder on your computer using terminal:

cd /path/to/core-interaction/site/studio

Then initialize a new github repo within this folder by running this command in the same terminal window. Make sure to swap out โ€˜usernameโ€™ and โ€˜repoโ€™ in the URL for your actual username and repo name:

git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/USERNAME/REPO.git
git push -u origin master

Step 2: Add CNAME File

Alright, your studio files should be up on git, and your studio folderโ€™s index.html should be at the root of that repository.

Make a new file in your studioโ€™s root folder with a filename of CNAME and add your domain info inside:

my-theme-site.com
www.my-theme-site.com

Now, add and push the changes in your local repo to github:

git add .
git commit -m 'add CNAME file'
git push origin master

Step 3: Configure Google Domains DNS Records

Open up a browser and go to 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.

Add two @ type A Records that point to the GitHub IPโ€™s: 192.30.252.153 and 192.30.252.154 and one www CNAME record that points to your USERNAME.github.io url

Your site should now be live at your given domain!