On a site hosted with Gitlab Pages, if I activate enableGitInfo, the Gitlab CI/CD generate an error, and the site is not deployed…
Error message in the pipeline output:
Building sites … ERROR 2019/08/19 05:08:23 Failed to read Git log: Git executable not found in $PATH
Total in 114 ms
Error: Error building site: logged 1 error(s)
ERROR: Job failed: exit code 255
Found nothing about similar problem on this forum.
Well that makes sense: the build script, for whatever reason, isn’t finding git in the path. But hugo doesn’t require git unless it is doing a git thing, like checking GitInfo.
I’m not sure what is included in the image at registry.gitlab.com/pages/hugo/hugo:0.55.6, but it looks like it’s about ~15MB, which I don’t think includes git. When I used a (self-hosted) GitLab CI build, I loaded a base Alpine image, and then installed git, hugo, etc.
On the other hand, you might be able to search gitlab.com and find Hugo deployment scripts similar to yours.