Use SinBlog with Travis CI

This tutorial talks about how to use SinBlog with Travis CI to deploy your blog site automatically.


What is Travis CI

CI is the abbreviation of Continuous Integration.

Ok, It's a little complicated......

Travis CI is a hosted continuous integration service used to build and test software projects hosted at GitHub. Travis CI provides various paid plan for private projects, and a free plan for open source. TravisPro provides custom deployments of a proprietary version on the customer's own hardware.


In short, Travis CI is a tool that can run automation scripts in your GitHub repository.

Check their website for more information:

It doesn't matter if you dono't understand what Travic CI do, Just follow this tutorial.


A GitHub Repository

First, you should have a GitHub account. If you don't, click here to register one.

Create a repository to store your blogs.

If you don't know how to use Git or GitHub, may be you are not very appropriate for this tutorial......

Setup Travis

Open in your broswer, click the big green button to sign up.

Follow the sign up guide and sign in at

Click the green Activate button, and select the repositories you want to use with Travis CI.

The official document is really explicit: Travis CI Tutorial


GitHub Token

In order to let Travis CI to control your GitHub repositroy, you need to generate a GitHub Token for Travis CI.

Follow this document: Creating a personal access token for the command line.

Select scopes as below:

Now you have a GitHub Token in your clipboard. Be careful don't lose it because you will not be able to see it again.

Set GitHub Token to Environment Value

Open the Dashboard at, choose your target repositroy.

Click More options -> Settings, scroll down, see the Environment Variables part.

Paste your GitHub Token in VALUE input, and set NAME to GITHUB_TOKEN, then click the Add button in the right.

Do not turn the DISPLAY VALUE IN BUILD LOG option on.

Add .travis.yml to your repo

Create a file named .travis.yml in your blog directory, and copy this configurations:

language: node_js
  - node
  - npm install -g sinblog
  - sinblog build
  provider: pages
  local_dir: dist
  skip_cleanup: true
  github_token: $GITHUB_TOKEN  # Set in the settings page of your repository, as a secure variable
  keep_history: false
    branch: master

Add .travis.yml to git control, and push it to GitHub.

SinBlog configurations

Add a sinblog.config.yml file. See SinBlog Docs for more details.

These are all steps you need to do.


How to publish a blog?

  1. Write a Markdown blog file, for example,
  2. git add
  3. git commit -m 'blog'
  4. git push

Then Travis CI will generate blog site, and push it to GitHub Pages. All is automacial.

For example, if your GitHub repository URL is, you can visite your blog site at