Using Travis CI add 'auto build & publish' feature for your jekyll site on Github

Mar 10, 2017

Github Pages is very powerful and it’s free to use. Nowadays many developers deploy their blog & project pages on Github Pages using jekyll.

You’re free to use Github Pages Builder by default. But if you want to use additional plugins or other powerful features of jekyll, you’ll need to build your site locally and then push it to your Github repo.

And every time you update your site or add new posts, you’ll need to build it again and push it up again.

It’s very annoyinng and a waste of time.

Can’t we use some methods to make it automatically happen?

Of course we can!



1.Set up your porject on travis-ci

Use your Github account login to Travis CI website.


Then go to your account setting page. And open the toggle button of the project you want to enable Continuous integration.


2.Add config file

Add a new .travis.yml file on the root of your project.

language: ruby
rvm: 2.2
install: bundle install
  provider: pages
  skip_cleanup: true
  github_token: $GITHUB_TOKEN # Set in dashboard
    branch: master # Or `gh-pages`

3.Generate a new Personal access tokens for your project

Go to your Token setting page.

Pree Generate new token button.


Select the right permission.


Add the generated token to your travis-ci project setting page.


4.Push & Test

Push a new commit to your repo. Then you’re able to see the build process log on travis-ci:


You’re good to go!


Do Not Remain Silent

Back To Top