Steve Ivy — Since 1999 — XV Ed.

Using Hugo and Continuous Integration to easily build a Static Website

Published November 14, 2015

Rachael Worthington is working on getting her blog set up as a static site built by Hugo, a new entry to the static-site generator field written in Go. She’s having a few issues so I thought I’d write about a recent site I set up with Hugo and how that site is getting built/deployed.

I recently set up a static website for my father at http://ivyarchpc.com. His site doesn’t change very often, and ought to load fairly quickly, so I figured rather than mess around with Wordpress or Drupal, I’d try Hugo. I’m pretty compfortable with Git so the site’s source code is hosted on Bitbucket (free private repos, yay). And while I can manage git from the command line without always losing my cool, I tend to use Github Desktop which acts much like any source code management app and keeps me from having to remember how to do partial-file commits.

I looked into several continuous integration services: TravisCI, CircleCI, and Codeship, because I wanted to get the site built and deployed whenever I pushed code into Bitbucket.

TravisCI is popular among the open-source set because they have a free plan for open source projects, the next plan up is $129/mo and that’s just not worth it for a couple of sites. CircleCI looked good but does not appear to support builds for Go-based projects.

I connected Codeship to my Bitbucket account, and crated a new project for the repo. I created two build pipelines (described in the article above, I won’t re-iterate here) - one builds off of the master branch and deploys to the main site. The other build pipeline builds from a feature branch (feature/responsive, for a responsive update to the site) and deploys to a subdirectory of the main URL.

My main build pipeline uses a “Custom Script” build with the following script:

Reactions

Comment Policy

Webmentions and pingbacks are supported here, so share your thoughts on your blog and I'll probably get notified about it. You can also send me an email instead - steveivy @ gmail.com. Or hit me up on Twitter: @steveivy or Mastodon: @sivy@toot.cafe.