Setting Up Travis CI for My Github Pages Site

Walkthrough of setting up Travis-CI for this site's Github repo.

This Page is Deprecated

I am no longer using Travis CI or Github Pages for this site. I started out on Github Pages, but I am now using Netlify, for a couple reasons:

  • Private repo support
  • Deployment previews

I have a new setup to validate the site, which I will probably post about at some point.


1) Enable Travis builds for the Github repo

Enable this on your profile page:


Optionally click the gear icon to configure more things:


2) Add the .travis.yml file in the project root:

language: ruby
- 2.2.0
script: bundle exec rake test

A couple things here:

3) Create a Rakefile in the project root, to automate build and test

require 'html-proofer'

# rake test
desc "build and test website"
task :test do
  sh "bundle exec jekyll build"
  HTMLProofer.check_directory("./_site", http_status_ignore: [999]).run

There is a known issue that LinkedIn articles return status code 999, which causes html-proofer to fail.4 That’s why I added http_status_ignore: [999].

4) Add the gems to your Gemfile

In a :test group:

source ''

gem 'github-pages', group: :jekyll_plugins

# test the build
group :test do
  gem 'rake'
  gem 'html-proofer'

5) Test that this works locally

$ bundle install
$ bundle exec rake test
bundle exec jekyll build
(blah blah)
rake aborted!
HTML-Proofer found 18 failures!

Then after fixing all those failures, run again and it should show:

HTML-Proofer finished successfully.

6) Check that this is working on travis-ci


If you configured this earlier to build pushes, push whatever branch you’re committing this to. May have to fix a few issues to get it to green:


And it should also show that it passed on github:


pull request

Submit a pull request, and it should show that it passed:


7) Add the badge thing to your file

Merge that PR, and Travis should build the master branch.

On your repo page ( in my case), click the badge that now shows “build | passing”. Select the markdown option to get the code for that:


Paste that code in the, and you will see that badge on your project page:


8) Get notifications on Slack

Start here, and click “new Travis CI integration”. Go through that to setup the channel that gets the notifications.

Before adding the config to .travis.yml it should be encrypted, since it contains an API token. This page explains how to do that:

$ travis encrypt [channel]:[api-token]
Please add the following to your .travis.yml file:

  secure: "CV7krTfkKRre...LdieyKfo="

Then add that to .travis.yml:

    secure: "CV7krTfkKRre...LdieyKfo="

And the next time I push something, it sends a notification in Slack:


All done!


  1. This is in a note under the Installation section here: 


  3. lists all of the available precompiled Rubies for Travis-CI 

  4. was closed, with workarounds described in the comments