Hugo on GitHub Actions

This might be the hundredth guide on how to run Hugo on you GitHub Pages and using GitHub Actions to auto generate your Page to serve it via https://<your-username>.github.io - but whatever, here we go!

Your Repository

  1. First you need a Repository called <your-username>.github.io - it doesn’t necessarily have to be a public repository. After creating the Repository, you can open the Repository Settings and find the Navigation Item Pages on the left side, under the Code and automation Navigation Header.
  2. Select “GitHub Actions” as your Source, select Hugo - which should be listed immediately as it’s probably one of the most popular choices here.
  3. In my first attempt i did not change any setting, let’s figure out if that already works. Funnily enough Copilot created the Commit Message and Title for me.
  4. Then I fiddled around with my repository since i was originally working in an old repo and the histories were impossible to merge yadda yadda.

Turns out: It does not work without configuration, but that’s okay.

The current error is:

ERROR TOCSS-DART: failed to transform "/scss/main.scss" (text/x-scss): "/home/runner/work/lakrizz.github.io/lakrizz.github.io/themes/chicago7/assets/scss/core/themes/default/_styles.scss:2:0": Can't find stylesheet to import.

[](https://github.com/lakrizz/lakrizz.github.io/actions/runs/19871101321/job/56946704014#step:7:16)

Which is a weird one to start because that file definitely exist in the Repository. It’s not dart-sass because that’s part of the Build configuration. Maybe I’ll need to adapt some paths in the Runner config. Nope, that was not it. It was far easier. Just check both your local Hugo version hugo version and then set the version in the runner (.github/workflows/hugo.yml) to match your local one. Now even the deployment works automatically. That’s actually it.

And you reading this post proves it.