July 14, 2018

Deploying a Website with goHugo.io, github.com, netlify.com and forestry.io

Since a good while I use the static website generator Hugo for my Blog (which (by the way) is back online since a few days (minus the photos) after I got rid of my vServer last month). As I do not have this vServer anymore, I neither have a repository that keeps track of my website’s source code, nor a machine that will automatically build the website’s html whenever I change something, nor a public web server to serve the website’s html.

My first idea was to use Github and Github pages to host the source code and serve the generated html. But I did not really like this as you had to rebuild, commit and push the generated html by yourself.

By accident I stumbled upon a quite interesting combination of different services that seem to work together pretty well.

Let us maybe start with Netlify. This is a service that hooks into Github and builds a Hugo project whenever it notices a change to the sources. Netlify will also serve the generated website for you so you do not need to operate your own web server. By defaullt, you get a subdomain for your website from Netlify, but you can also configure own domain names! The second best thing about this service is that it is free for small websites like this one. The maybe best one is: Netlify automatically takes care that you obtain a free certificate from Let’s Encrypt. Pretty amazing stuff.

For those who do not want to fiddle around with source code and Git repos, forestry.io is the right thing. This service again hooks into Github but this time the service does not consume the sources but produce them: the forestry.io acts as an editor that allows you to modify existing or write new posts in a convenient wysiwyg editor. All complexity of markdown syntax, git commands, etc. is entirely hidden from the user. Again, the basic service is free to use.

Update (written a few hours after initally posting this text): Of cause you can pair both services with Gitlab. The benefit of using Gitlab over Github is that Gitlab offers private repositories with their free accounts. That is pretty nice and as I prefer to have the source code of this website private, I created a free Gitlab account and migrated the code to Gitlab.

To conclude with a post I wrote some days ago on Twitter:

Earlier, we used a php app on a LAMP stack for our website.

Now we save the site’s markdown on #github, let @Netlify build the site using @GoHugoIO, and as we are too lazy to write markdown and push stuff to github, we edit the site in @forestryio.

I love low complexity.

© ho1ger 2015 - 2022