I’ve been trying to figure this part out for a few days. I have my own Forgejo instance and a website each running in separate containers on a Raspberry Pi. I also have the forgejo runner installed in another docker container. I followed some guides to set up forgejo actions, but all the guides end with a simple example that basically just runs the “ls” command.
I tried running ‘docker compose up’ inside my workflow, but it fails with “docker: command not found”. So how do you use the workflow to actually update the website in the other container?
I think I’d prefer keeping everything in docker but I’d be okay with making the workflow run some script on the host machine if needed.
Forgejo actions > Coolify. Done. I use Forgejo’s container registry.
The error is because the runner container has no docker client and no access to the host’s daemon. The usual fix is to mount /var/run/docker.sock into the runner and use a job image that ships the docker CLI, then docker compose up -d works from the workflow. Keep in mind that socket is basically root on the Pi, so only run workflows you trust.
AFAIK, Actions are for building artifacts for the repo that can then be used by other services to deploy. Like it’ll run a Dockerfile to build a new image, but you still need Watchtower to update your running stack from the repo tag.
Not much experience with Forgejo, but for the docker compose part, you can just ssh to the host machine. Guess you’re just depending on :latest for your app, otherwise it won’t work (unless you generate your compose file). The whole script can reside in the pipeline, or in a separate repo on the host, whatever is easier.
Use key auth for ssh and run the whole thing under a non root user that’s part of the docker group. Beware the permissions inside the Web app container too.
Creare a step before your ‘docker compose up’ that does a apt get update apt get upgrade and then installs docker and docker compose.
Every time the action runs you are going to get a brand new clean ephemeral environment. You can shortcut the install steps by pointing it to an existing container that has docker isntalled on it, or building one yourself. But the easiest way is to just add a step to install the things you want in the container during the run.
I’ve used SaltStack since 2018 but am looking into migrating to Ansible. If I used CI/CD, I’d still use Ansible to do the actual deployment work.
I self-host web apps and use Forgejo. I got all my docker compose files in one repo. Works for both: off the shelf apps and self created. For self created apps I use separate repos with the code and Forgejo Actions that build the Docker image and push it to the Forgejo registry. But I don’t deploy the containers with Forgejo Actions. For deployment I use Komodo. Whenever a change to the Docker Compose repo happens, it will re-deploy changed docker compose files. When I initially set it up, this guide here helped me a lot.
Updates via renovate-bot (also runs in Forgejo Actions).
deleted by creator



