Need assistance with Hugo's official Docker image for continuous deployment

Hello,

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.

Here is the section of my workflow hugo.yaml:

jobs:
  clone:
    runs-on: ...
    container:
      image: ghcr.io/gohugoio/hugo:v0.155.3@sha256:a97a8429a9226bbf8fbbc98e418723b071d9b113222a8bc947511e9b4043e58d
      credentials:
        ...
    steps:
      - name: Clone the repository
        uses: https://code.forgejo.org/actions/checkout@v6
        with:

How do I provide my container with the `hugo` command, but also make it a normal container?

I have no experience with Forgejo or Codeberg, but this workflow for GitHub Pages works great.

The live site is here:
https://jmooring.github.io/hosting-github-pages-official-docker-image/

The workflow:

  • Includes Git, Go, Dart Sass, and Node.js pre-installed in the image
  • Uses a persistent cache for downloaded modules and processed images

The persistent cache makes this workflow very efficient.

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

Related: https://github.com/gohugoio/hugo/issues/14502