Deploying Octopress on github with your domain

Quick summary about how to download and deploy an octopress blog on github.


2 min read
Deploying Octopress on github with your domain

I started to write this post because I want to have some place to remember how to install (quickly) another octopress, and I'm too lazy to read again all the documentation.

I followed steps explained on Octopress documentation, but mainly it consists on clone Octopress repo and install required gems:

git clone git://github.com/imathis/octopress.git jorgemaroto.es
cd jorgemaroto.es
bundle install #

After that, you need to create a repository on Github as they explain on their github guide, you can choose between two ways.
In my case I going to create a repo with my name (patoroco.github.io), so after that I can update all the content to master branch. At this point, you can execute rake task, which will be a wizard to configure all.

rake setup_github_pages
rake install

By default it uses classic theme, but I was looking other options, and finally I decided to use darkstripes theme, so if you want to try it, follow these steps:

git clone git://github.com/amelandri/darkstripes.git .themes/darkstripes
rake install['darkstripes'] # again, this will ask you about overriding your current theme 

At this point, you can run rake preview on your terminal, and your site will be available on http://localhost:4000.
Ok, this is a good time to publish your blog, and start to share with your friends how cool you are, so first of all you need to create a new repo on your github with your username, in my case it was http://patoroco.github.io. This would be enough, but I want to use myself domain, so I create a file named CNAME inside source folder (that's jorgemaroto.es/source/CNAME), with the name of my domain:

jorgemaroto.es

Obviously I needed to make a change on my domain configuration, so I recommend you that check Github Pages with custom domain page, because they explain it better than me :).

Finally, you need to edit some parameters on _config.yml file as follows:

url: http://jorgemaroto.es
title: Jorge Maroto
subtitle: Trying to write a blog (again).
author: Jorge Maroto
simple_search: http://google.com/search
description: Here I'll try to write a blog somewhat more technical than in the past, and in English!

After that, you can run rake deploy, and you can now access to your website using selected domain (it could take some hours).

It's important to highlight that with rake deploy, you are uploading to github static files only, so it's recommendable to push also your source files (that is markdown files, sass, etc) without compile.
Octopress makes it very easy because you always work on a branch named source, and when you deploy to master branch, it does that automatically, so at this point you only need to push your source branch:

git push origin source

On the next post, I'll explain which configuration I did to customize title, social networks, and other.

Related Articles

Editing 404 page on Github pages
1 min read
Configuring Octopress
1 min read
Why Octopress?
1 min read

GO TOP