# Setting up Travis, Jekyll and GitHub pages

DevFeed: [Setting up Travis, Jekyll and GitHub pages](<https://devfeed.tech/articles/setting-up-travis-jekyll-and-github-pages-37366.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/travis-jekyll-and-github-pages/>)

Author: Stanko

Published: 2016-10-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [Jekyll](<https://devfeed.tech/topics/jekyll.md>), [Travis CI](<https://devfeed.tech/topics/travis-ci.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [GitHub Pages](<https://devfeed.tech/topics/github-pages.md>), [ci](<https://devfeed.tech/topics/ci.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [github](<https://devfeed.tech/tags/github.md>), [github-pages](<https://devfeed.tech/tags/github-pages.md>), [github-personal-access-token](<https://devfeed.tech/tags/github-personal-access-token.md>), [jekyll](<https://devfeed.tech/tags/jekyll.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [security](<https://devfeed.tech/tags/security.md>), [travis](<https://devfeed.tech/tags/travis.md>), [travis-ci](<https://devfeed.tech/tags/travis-ci.md>)

## AI overview

This tutorial explains how to use Travis CI to build a Jekyll site and publish the generated files through GitHub Pages. It describes branch setup, webhook activation, a GitHub Personal Access Token, Ruby gem configuration, and a Rake task. The author warns that the setup may be outdated and no longer uses it.

## Source excerpt

Please note that I'm not using Jekyll anymore, so this post might be outdated. Update, November 2017 # I don't use this setup anymore, it might be outdated, proceed with caution. Original post # As I already mentioned, GitHub pages do not work with the Jekyll plugins. It is a security measure. So I researched it a bit, and colleague of mine proposed a simple solution - Travis CI. There is a great repo with instructions how to set everything up - jekyll-travis. But few steps are kinda confusing, and it took me 10 failed builds to make it work. So I'll try to help you with those. I copied the steps from the original repo and updated steps where I got stuck. Be sure to check the original readme as well. Flow # When you push to your GitHub repo, it triggers Travis Travis starts up a virtual machine and installs all required software (mostly Ruby gems). We use a custom rake task to tell Travis how to build our Jekyll site and push the updated content back to Github Travis clones a source branch (usually master or source, in my case source) Travis runs jekyll build on the source branch Travis does a git push to the branch holding static site files (usually gh-pages or master, in my case master) Github Pages starts serving the updated site Steps to make it work # Move your Jekyll source files to the source branch (name it as you like). We'll use master or gh-pages branch to host generated HTML website. Make sure you have enabled your source repo in the Travis CI admin dashboard so that the webhook is triggered Create a GitHub Personal Access Token from you profile page. If you haven't already, create a Gemfile, and add rake gem to it. source "http://production.cf.rubygems.org/" gem "rake", "~> 10.1.1" gem "jekyll-paginate" gem "jekyll-archives" We have seen intermittent timeouts fetching gems from Rubygems.org. install: bundle install lets Travis CI automatically retry, and we are using source "http://production.cf.rubygems.org/" in Gemfile to point to a different reposito