site built with hugo and github actions

Posted on Aug 17, 2022

i wanted to rebuild my site, just a little lift to streamline the workflow again. i also was inpsired by https://maxammann.org/ and the open transparent work of https://ashleyblewer.com/. previously my site was built with jekyll, then hugo. then i started to dig into nextjs and gatsby. i want to go with a static site generator so that it’s easy to maintain and has a lot of nice features out of the box.

i tried the netlify integrations, with the one click cms, and d00d is it overkill. i don’t think i need a ci/cd pipeline with backups and staging environment, automated builds and analytics for my site with 10 blog posts and no viewers….no no the marketing strategy for me™ needs to come first.

anyhow. i finally settled on hugo. again. it still has a bit of the old school charm - themes are shared and are contributed by users like you, and if they are continually updated they go on their site. it’s indie cute! the other static sites (gatsby etc) feel quite professional, they don’t share other peoples’ work, you should do you. and get paid. no sharing, k? jekyll is a bit old and clunky now.

my previous hugo workflow involved two repositories, https://github.com/kimpham54/kimpham54.github.io and https://github.com/kimpham54/kimpham54-hugo. i built the site on kimpham54-hugo and then it was built, then the public folder was copied over to kimpham54.github.io. a little manual, a little pain. soon the theme i was using was no longer being updated so i could no longer build. i had to think of another plan.

it now only uses kimpham54.github.io, the hugo site has been rebuilt with the archie theme https://github.com/athul/archie, i migrated my content over, i did some minimal styling overrides in layouts and assets, and it now uses github actions to push the public site to the gh-pages branch. it took me a long time to realize that it wasn’t deploying properly because i didn’t rename all the main branches to master (still had master naming convention on my mac). weird thing is that it sometimes built, so i was getting mixed content since i accidentally when it built used the baseurl as http://kimpham54.github.io instead of https, then realized i needed to put a slash or it wasn’t constructing relative links properly, https://kimpham54.github.io/. it’s the silly things.

so the new workflow is:

  1. pull down https://github.com/kimpham54/kimpham54.github.io
  2. add content, tweak away
  3. git add, commit, push
  4. github actions should deploy automatically