Resolve first run errors when using for CI/CD

I discovered recently and been using it for automating build and deployment CI/CD: I’d have used Hugo Github Actions but I need rsync (and the rsync github action seems broke/unsupported).

Couple of pointers for anyone else trying and resolving first run errors. You’ll see this error when you first run Hugo action on

hugo -c /buddy/<your project>
ERROR 2020/07/14 17:19:47 Failed to read Git log: Git executable not found in $PATH
Building sites … Total in 381 ms
Error: Error building site: "/buddy/<your project>/archetypes/": failed to unmarshal YAML: yaml: did not find expected key
Action failed: see logs above for details

The 3 things to change are:

  • Environment - is missing Git (add Git)
  • Environment - Outdated Hugo version (its using 0.54)
  • Run - Invalid Working directory

Under Environment … change it (note I use Hugo extended)

apt-get update && apt-get -y install git
apt-get update && apt-get install -y wget
#wget -O hugo.deb
wget -O hugo.deb
dpkg -i hugo.deb
rm hugo.deb

Under Run … change the Hugo build command … you dont need the $working_directory. Use what you prefer, I like hugo --cleanDestinationDir --minify