In this article, I share the tools, processes and practices I use for releasing updates to this website.
The tools I use
Going live is fast
As soon as I push my code to the remote master branch on GitHub, Netlify executes the build command to execute Hugo’s static site generator and the site becomes live within seconds. As simple as that.
I use three different types of branches to develop this website, a master branch that contains the source code for the website you are viewing, a staging branch for previewing content and various spike branches for exploring new features. Netlify can supply separate URLs for each of these branches.
A staging branch is used for previewing changes
I use a staging branch for previewing changes. When I push changes to this branch I am able to preview the content with a separate URL before the changes go live. This is important because it allows me to see the changes I have made without making changes to the “real” website. If I am happy, I merge and push the changes to the remote master branch and the changes are live within seconds.
Spike branches are used to experiment
If I am trying something new and I don’t really know which direction I am heading, I create a spike branch. On this branch I try new things, expecting a lot of it to be thrown away. Once I know what direction I am heading I switch back to the staging branch without merging the changes. Instead I reimplement/copy what is needed to keep the code clean. An example is a “spike-share-content” branch that I created to figure out how to implement share buttons for Twitter and Facebook. When I was done, I copied what was necessary into the staging branch and kept developing until I was ready to merge it into master.
Changes/Commits are small
I try to keep my changes/commits as small as possible. I do this because it helps me to stay focused and I know if something goes wrong I have something to fall back on that has a high chance of being stable. The smaller the commit the easier it is to figure out what and when something went wrong. I learnt this lesson developing enterprise software for the first time.
This is the process and the practices I use for deploying my personal static website. Netlify makes this a very pleasant experience by making it possible to go live within seconds, preview changes before going live and make changes as small as I need them to be.