Trying Netlify
By Martin Hutchinson
The site as of the first post was hosted on GCP using Cloud Storage, as per these instructions. This worked reasonably well and I was able to pick regions in such a way that for the small amounts of traffic I’m expecting, the cost was zero.
The downsides of hosting via Cloud Storage were:
- No ability to add SSL certificates
- Setting up automation to push changes to the website was going to be an adventure
The first of these problems is solvable by moving to Firestore. However the second problem isn’t solved by that route.
I’d seen Netlify mentioned a few times and I’m trying it now. I’m still at the point where it feels too good to be true, which means it probably is. It solves both of these problems in spades. Netlify promises to:
- Automatically build my site using Hugo whenever there are changes in my (currently private) Github repo
- Push the contents of those changes public
- Host the content for free
- Automatically issue SSL certs
If you can read this post as the most recent post then it works! If you can read this post and there’s another one immediately after saying there’s a catch, then I’ll probably be back on GCP. Science!
Notes
That was really fast. The website was generated and live seconds after pushing my commit to Github.
Note to self: remember to actually push the commits to Github. I spent a few minutes after making the commit thinking that the Continuous Deployment promise wasn’t working. In fact, the changes were still local to my machine. Classic Git error.
I’m going to update these notes via a Pull Request instead of committing directly to master
to see how that flow checks out.
If the preview it promises is legit, then this could be a really tasty way of setting up a website that
non-technical people could learn to live with.
It’s not as easy as a WYSIWYG, but the upsides might make the barrier to entry worth it.
The deployment preview on the Pull Request works, and it’s quick. There is a big problem though: for this site at the moment clicking any link in the preview escapes from the deployment. I’ll need to look into coercing Hugo to generate relative links instead of absolute links. That said, it’s still workable; the preview gives a link to each of the pages that have changed directly so you can see the content. You just can’t easily navigate it.