Automate Blog Deployment with Travis CI

· 1 min read · 108 Words · -Views -Comments

Travis CI is a hosted, distributed continuous integration service for GitHub projects.

Background

My blog lives on GitHub. The master branch holds the generated static site, while source stores the Hexo project. Before automation, publishing a new post meant:

# 1. Stage changes
$ git add .
# 2. Commit
$ git commit -m 'update'
# 3. Push to remote
$ git push
# 4. Generate + deploy static site
$ hexo g -d

After CI

Now any push to the source branch triggers Travis CI to build and deploy to the static-site branch automatically. I only write posts and push—the deployment step (4) is handled by CI.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover