So I discovered Buddy.works recently … I wanted to automate the build and deployment of my website since I started using Hugo as automation means less chance of errors from having repeatable tasks which are done for you, not by you - giving you more time to write, read, exercise, whatever. When you first connect Github to Buddyworks it detects that you have Hugo and suggests what action to build.
This article is to save you time and identifies a few things you need to change.you need to change. I’ll show you to resolve first run errors:
- Add Git
- Out of date version of Hugo
- Invalid $working directory
- Test and resolve
I’m a fan of Continuous Integration and Continuous Deployment (CI/CD) , and previously used Jenkins; I had hoped to use Github Actions for Hugo, but I needed rsync because of my current hosting solution and Github Action for rsync was broken. Which is where Buddy.works fits in.
Buddy.works (and there will be other web apps in this category) allows you to create pipelines that do things - in my case, build Hugo and then deploy the site using rsync. You can also use it to automate testing, etc
Buddy.works out of the box Hugo action is broken
Buddy.works out of the box setup for Hugo has no git, uses a build command that points to a wrong working directory and running on a very old version of Hugo
When you first try to run your Deploy pipeline, it will error quickly …
- Failed to read Git log: Git executable not found in $PATH
- Failed to unmarshal YAML: yaml: did not find expected key
|
|
Corrections in Buddy.work Actions
There are 3 corrections to make …
- Add Git to Environment
- Update the Hugo build command
- Update the Hugo version
So go ahead and edit the Hugo action …
Run - Update the Hugo build command
The existing command points to an invalid $WORKING_DIR
which we don’t need as all the content is in Git
So go ahead and change it to what you prefer … I like hugo --cleanDestinationDir --minify
Environment - Add Git and Latest Hugo and Extended
Click on Environment. Below is the standard text code … with no Git and a very old Hugo
|
|
Go ahead and change this to add in Git and a fresh Hugo:
|
|
Note: remember to check if you are using Hugo-extended (hint if you use SCSS then use Hugo Extended)
Test and Go …
So now …
- Save the project
- Run it again
- enjoy some down time for a moment
- then add in your deploy action (rsync or whatever)
If you find a problem
- check all your code is in Git
Contact me today to find out how I can help you.