HUGO

Resolve first run errors when using Buddy.works for CI/CD

I discovered buddy.works 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 Buddy.works and resolving first run errors. You’ll see this error when you first run Hugo action on Buddy.works:

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/default.md:2:1": 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 https://github.com/gohugoio/hugo/releases/download/v0.54.0/hugo_0.54.0_Linux-64bit.deb
#extended
wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.73.0/hugo_extended_0.73.0_Linux-64bit.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