aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/doc/usage/actions/act-runner.en-us.md
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-16 00:09:03 -0400
committerGitHub <noreply@github.com>2023-06-16 12:09:03 +0800
commit99d71b2b652369bc0314dbcdf7f7373b0552b44e (patch)
tree9cf945ac20a34ec8eeaac4d3e7d00786286ce850 /docs/content/doc/usage/actions/act-runner.en-us.md
parent783f7ccb2c84f41a3b33ccfe4a8212361266dd87 (diff)
downloadgitea-99d71b2b652369bc0314dbcdf7f7373b0552b44e.tar.gz
gitea-99d71b2b652369bc0314dbcdf7f7373b0552b44e.zip
Docs about how to generate config for act runner with docker and setup it with docker-compose (#25256) (#25296)
Backport #25256 by @thezzisu In this pull request, the following changes are addressed: - State user should create `config.yaml` before start container to avoid errors. - Provided instructions to deploy runners using docker compose. Co-authored-by: Zisu Zhang <thezzisu@gmail.com>
Diffstat (limited to 'docs/content/doc/usage/actions/act-runner.en-us.md')
-rw-r--r--docs/content/doc/usage/actions/act-runner.en-us.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/content/doc/usage/actions/act-runner.en-us.md b/docs/content/doc/usage/actions/act-runner.en-us.md
index b654fe2efa..ddab43530e 100644
--- a/docs/content/doc/usage/actions/act-runner.en-us.md
+++ b/docs/content/doc/usage/actions/act-runner.en-us.md
@@ -76,6 +76,12 @@ The default configuration is safe to use without any modification, so you can ju
./act_runner --config config.yaml [command]
```
+You could also generate config file with docker:
+
+```bash
+docker run --entrypoint="" --rm -it gitea/act_runner:latest act_runner generate-config > config.yaml
+```
+
When you are using the docker image, you can specify the configuration file by using the `CONFIG_FILE` environment variable. Make sure that the file is mounted into the container as a volume:
```bash
@@ -172,6 +178,27 @@ It is because the act runner will run jobs in docker containers, so it needs to
As mentioned, you can remove it if you want to run jobs in the host directly.
To be clear, the "host" actually means the container which is running the act runner now, instead of the host machine.
+### Set up the runner using docker compose
+
+You could also set up the runner using the following `docker-compose.yml`:
+
+```yml
+version: "3.8"
+services:
+ runner:
+ image: gitea/act_runner:nightly
+ environment:
+ CONFIG_FILE: /config.yaml
+ GITEA_INSTANCE_URL: "${INSTANCE_URL}"
+ GITEA_RUNNER_REGISTRATION_TOKEN: "${REGISTRATION_TOKEN}"
+ GITEA_RUNNER_NAME: "${RUNNER_NAME}"
+ GITEA_RUNNER_LABELS: "${RUNNER_LABELS}"
+ volumes:
+ - ./config.yaml:/config.yaml
+ - ./data:/data
+ - /var/run/docker.sock:/var/run/docker.sock
+```
+
### Configuring cache when starting a Runner using docker image
If you do not intend to use `actions/cache` in workflow, you can ignore this section.