I will be completely honest with you, I already saw a couple of articles about this problematic but I find it SO COOL that I wanted to write about it anyway!

The thing is that back in the days (could be 2005, still in high school) when I was trying to put together first terribly written pieces of HTML, the idea that I can hang my website online for free without professional web hosting or banner covering half of the content would seem surreal.

Today it’s year 2015, the possibilities are endless and I LOVE how easy it is to try out new ideas.

Sentimental rant off ! Let’s get to the business…

Prototyping with GitHub

I have been doing quite a lot of prototyping lately. Trying out new ideas, testing hyped frameworks or implementing project seeds. GitHub is obviously a go to solution for these types of projects.

It’s always nice to have a possibility to easily share your code with friends & colleagues…

What’s really great about GitHub is that it provides you with possibility to easily create a web page about your project (repository). It’s even possible to generate statics web site from repository’s README.md! This feature is called GitHub Pages and it’s implemented in such a way that any content present in the gh-pages branch of your repository will be exposed on the url like this http://<username>.github.io/<repository>. The question that came naturally was…

What if instead of a statically generated repository info site we use GitHub Pages to host the project itself?

And you know what? Let’s automate the whole process too!

Travis CI

Travis CI can be thought about as SaaS solution for Continuous integration and the best part is that it is possible to use it for free with all your public GitHub repositories.

I hope you are already using Travis CI for continuous integration of your projects running all the tests on every push. If that’s not the case, then check out this official guide to using Travis CI with your GitHub repository.

Job configuration

Travis CI contains complete list of your public GitHub repositories. Here you can enable build for any particular repository and adjust the job’s settings. The most important thing to do here is to set two environment variables — GH_TOKEN and GH_REF. These variables are later used by our deployment script.

The good thing about Travis CI is that it contains option to hide these variables from build log which is useful because GH_TOKEN is our GitHub API access token and it is definitely in our interest to keep it secret.