.gitignore | ||
compose.yaml | ||
config.yml | ||
config.yml.bk | ||
edit_config.sh | ||
README.md |
Forgejo runner guide
This guide shows how to set up a runner with Docker Compose, since the instructions in the official documentation/repo example are confusing and error-prone.
Generate config and register runner
Clone this repo and access it with your shell. Then run:
mkdir runner-data
chmod -R a+rw runner-data/
docker run --rm -ti -v $(pwd)/runner-data:/data:z code.forgejo.org/forgejo/runner:3.5.1 sh
This will create a container that already places us on the mounted volume (you can cd /data
to make sure). Now we'll generate a default config.yml
and a .runner
, respectively.
forgejo-runner generate-config > config.yml
forgejo-runner register
The second command will start an interactive setup. Enter the fields as prompted:
- The first prompt will be your repo's URL.
- The second prompt will be a secret to authenticate your worker (in my case, I got it from
/admin/actions/runners
> Create new runner > Registration token). - The third will be the name of your runner (just
runner
is fine). - The fourth will be the labels to use. Simply copy the ones shown below.
In my installation, the inputs I entered looked something like this:
https://git.badmanners.xyz
A...z
runner
docker:docker://code.forgejo.org/oci/node:20-bookworm,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04
Then, once we make sure that we have both files in the directory, we can exit the shell with Ctrl+D.
Edit config.yml fields
We need to change some default fields in config.yml
. Just run ./edit_config.sh
, and it will automatically take care of it for you.
Start daemon
Finally, we can start our worker:
docker compose up -d
Enjoy! 🍻