Skip to content

Project Talk

Site Migration

I have recently migrated my site from a VPS i was using to GitHub Pages.

Now that blogging is enabled and the eventuality that i might need to make quick changes to some portion of the site at some point has made me rethink how i deploy changes to the site's pages and media files.

Previously, i manually built the site using Zensical's "build" command and uploaded the entire bundle of files to a webserver, where they would then be served by Caddy, but this approach is likely to become more and more cumbersome as the complexity of the site, and by extension Zensical, increases over time.

GitHub allows you to trigger certain actions when something happens via the usage of so-called "workflows". For instance, you could trigger the build of your project when something gets merged into your "master" or "main" branch, which then creates a Release with the built binaries and a changelog attached.

Most projects use this to automate the creation of binaries for different operating systems or CPU architectures, but i use it slightly differently.

Instead i have it do a number of things for me, automating the process to a great degree.

  • First, it downloads the correct Python environment
  • Second, it installs the requirements, which for now is just Zensical 0.0.65
  • Third, a call to invoke the "zensical build --clean" command occurs, which produces a bundle of files comprising the website
  • Fourth, GitHub Actions uploads this bundle or an "artifact" as it is called to GitHub Pages
  • Finally, GitHub Pages makes the files contained in the workflow artifacts available as a website that can be reached via a custom domain and enforces HTTPS for me

This workflow roughly mirrors the actions i took when i used to build the site and remove old files manually. What used to take many minutes now takes a handful of seconds at the very most, not including any overhead.

For you, the reader, nothing will seem too different, other than more consistant load times since the site is now hosted on a faster, more available platform, but for me it will help me deliver better content in less time.