Published November 2, 2020
(This article is a high level sketch.)
When setting up this static website, I wanted as easy a path as possible for getting content from my laptop to the website.
There are a lot of systems that do automatic deployment of changes. I wanted something simple, low cost, and which was going to be around a long time. Several of the systems I looked at had generous free plans (Netify, for example), but they are young companies and I’m not sure how long they will be around. If a company goes bankrupt, I have to change a bunch of stuff.
I figure Amazon Web Services is stable and the business model for ultra-low cost highly reliable bulk data storage is a proven model. AWS has mature competitors.
I’m comfortable using Git for version control and Github.com stores version control repositories for most of the worlds open source. So it seems stable enough.
And Github has this thing called “Runners”. They are little virtual server tasks you can have Github run when something happens. For example, when a new version of the website gets pushed to the remote software repository, run an action.
An action like check out the latest version and copy any changed files over to Amazon Web Services.
Github charges for this but they have a generous free allotment of minutes you can run per month. So as long as I stayed under 2000 minutes per month, I can have a little virtual computer at Github do work for me. That seemed like it was probably a good solution.
Then I saw that Github has “self-hosted” actions that you can run for free. If you don’t want to use their little virtual computers to do work, you can host them on your own computers. The only requirement is they run something Linux like. Hey, my Raspberry PIs run Linux, would they work?
Yes, in fact.
So a spare Raspberry PI I have sits around listening for commands from GitHub and then publishes my website.
(The only thing left to do is have it purge the cache at the CDN I’m using to speedup the website).
GitHub is free as long as I’m storing less than 2GB of website or program code there. That’s easy so far. My Raspberry PI uses about 3W power then it’s idle, maybe 5W when doing something interesting for me. Storage and bandwidth at Amazon is probably about 10 cents a month. I’m pleased with the solution so far.