I am trying to deploy Hugo automatically with CI/CD.
I am trying to clone a repository with `https://code.forgejo.org/actions/checkout`, this works fine.
Now I am trying to build my hugo website in the same workflow.
I am pulling the docker image of hugo `ghcr.io/gohugo/hugo`, this also works fine as a separate step, but when trying to combine the both tasks it fails with:
::error::Unable to locate executable file: ssh. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
My explanation for this is that the workflow only loads the docker image, and nothing else and only has access to the `hugo` command.
Thank you.
The workflow you provided me, kind of looks like the one I got.
I thought the Issue was that the `ssh` command was not provided in the `ghcr.io` image, but in your workflow its the same image, and you also use `actions/checkout` afterwards.
Could this also maybe be an indentation/newline issue?
Yes, but I’m checking out a public GitHub repository… ssh is not required. Additionally, I have no idea if code.forgejo.org/actions/checkout behaves differently than github.com/actions/checkout.
Add this step before checking out the repository, and test again:
- name: Setup system tools
run: apk add --no-cache openssh-client tar
I’d like to get back to the original problem, but from your response it is unclear if you actually made the changes I suggested before your gave up on the container approach. As I mentioned above, this container setup works great for GitHub Pages:
And with v0.156.0 and later the image includes openssh-client.
Your snippet worked perfectly, thank you
Maybe the issue was that openssh-client is installing the ssh binary under /sbin and I needed the option --user: root… But I’m not sure