February 1, 2018
A couple weeks ago, I migrated my blog from Tumblr to a static site generator. (I ended up settling on Hugo, but my choice of tool is irrelevant for this post.) When it came to deployment, I decided to have the generated HTML live on GitHub Pages since it’s free, easy to set up, and my source code (content, theme, and configuration) were going to live there anyway.
The easiest way to accomplish this with minimal setup is just to have your site generator output your built site in a folder called
/docs. Rebuild your site after any change you make, push to
master, and you’re good to go.
This solution was fine at first, but it got a little annoying having to manually re-build my site and commit the output of that build on every change. Not to mention the fact that committing build artifacts to version control broke my heart a little. I wanted a way to keep only my source chances in my git history (with the build folder in
.gitignore), and have the build and deployment process happen automatically when I pushed my source code to GitHub.