From 0dcf5488d27e53a570113f9455a8ccf1cbccddb0 Mon Sep 17 00:00:00 2001 From: William Turner Date: Sun, 23 Aug 2026 10:53:18 +0000 Subject: [PATCH] Fix Actions runner: use docker-capable job image, mount docker socket, add manual trigger --- .gitea/workflows/build.yml | 3 +-- act-runner-config.yaml | 6 ++++++ docker-compose.yml | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 act-runner-config.yaml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 77aab51..0e085b3 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -5,11 +5,10 @@ on: paths: - "agent/**" - ".gitea/workflows/build.yml" + workflow_dispatch: {} jobs: build-and-push: - # If your act_runner advertises a different label than "docker" (check its - # config.yaml / GITEA_RUNNER_LABELS), update this to match. runs-on: docker steps: - uses: actions/checkout@v4 diff --git a/act-runner-config.yaml b/act-runner-config.yaml new file mode 100644 index 0000000..0a8cf28 --- /dev/null +++ b/act-runner-config.yaml @@ -0,0 +1,6 @@ +# Mounts the host Docker socket into every job container act_runner creates, so +# `docker build`/`docker push` work inside workflow steps (Docker-outside-of-Docker). +# This is a runner-admin-controlled default (not something a workflow author can +# request itself), which is the safer of the two ways act_runner supports this. +container: + options: "-v /var/run/docker.sock:/var/run/docker.sock" diff --git a/docker-compose.yml b/docker-compose.yml index d545743..215762e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,10 +84,14 @@ services: GITEA_INSTANCE_URL: ${GITEA_URL} GITEA_RUNNER_REGISTRATION_TOKEN: ${ACT_RUNNER_REGISTRATION_TOKEN} GITEA_RUNNER_NAME: gitops-vps-runner - GITEA_RUNNER_LABELS: docker:docker://node:22-bookworm + # catthehacker/ubuntu:act-latest is the standard job-container image for + # act/act_runner — includes git + docker CLI, which job steps need. + GITEA_RUNNER_LABELS: docker:docker://catthehacker/ubuntu:act-latest + CONFIG_FILE: /etc/act_runner/config.yaml volumes: - /var/run/docker.sock:/var/run/docker.sock - act_runner_data:/data + - ./act-runner-config.yaml:/etc/act_runner/config.yaml:ro networks: - web