From Github Pages to Firebase, then to a VPS


This website is now hosted on a VPS

381 words · 2 min read

Ever since I went static, I have been using Github Pages, an almost perfect solution for small static sites.

The only real shortcoming of Github Pages is the lack of control over the webserver, and hence the lack of control over caching and server-side redirect. While using Cloudflare does give you back some control, redirect capability remains lacking.

A few weeks ago, I moved the site to Firebase, which was a step up from Github Pages in terms of its flexibility, though I remained somewhat dissatisfied for various minor annoyances. For instance, deployment to Firebase involves pushing all the files to Firebase instead of only new and changed files, which isn’t a problem if this isn’t 2016. Unlike Github, where you can view the files on Github website, there was no way to view the files on the Firebase Console (except the files count, which is rather pointless). Also, and this is in large part my fault, the change in my workflow has a number of issues that I couldn’t resolve.

After searching for more alternatives, I came to the conclusion that the best result could only be had if I host my own website on a VPS.

Caddy Webserver

Caddy is a lightweight webserver written in Go (same as Hugo), with interesting features such as automatic SSL, HTTP/2 support, experimental QUIC support, and more; and it is easy to set up. It also has an optional git add-on that pulls updates from remote git repositories, a fantastic feature for people who want to deploy their sites with git.

For further information on how this site is set up and deployed, see the post on Hugo site deployment with Github, Travis CI, and Caddy Webserver

I stumbled upon Google Firebase on this blog post, and I decided to give it a try. Google Firebase offers fast and easy-to-setup static site hosting that solves every last problem with Github Pages. Not only that, it offers free SSL in its free plan (1 GB storage and 10 GB download limit).

Switching away from Github Pages requires a new workflow, but with some small changes to my deployment scripts, I have been able to adapt to the new workflow with relative ease.

For more detailed instructions, you can visit the documentation of Google Firebase.

 Tech    24 Jul, 2016
 Github    Hugo    Static Site  
Copyright © Peter Y. Chuang 2018

Peter Y. Chuang is a Hong Kong-born novelist, short story writer, and a music critic who has lived in London at a time and now goes to Berlin semi-regularly for no good reason. When he’s not writing or reading, he’s probably playing with his cat, or listening to classical music, either at home or at one of the opera houses and concert halls in Germany. He uses Linux (current distro of choice: Arch Linux). Read more about his Linux stuff.

You may also like...