Files
billai/docker-compose.runner.yaml
CHE LIANG ZHAO a5f1a370c7
Some checks failed
Deploy BillAI / Deploy to Production (push) Failing after 26s
feat: 改用 Docker 模式运行 Gitea Actions
2026-01-26 18:30:28 +08:00

43 lines
1.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Gitea Actions Runner - 自动部署
#
# 使用方法:
# 1. 在 Gitea 仓库获取 Runner Token
# 访问https://git.fadinglight.cn/clz/billai/settings/actions/runners
# 点击 "Create new Runner" 复制 Token
#
# 2. 创建 .env 文件或设置环境变量
# echo "GITEA_RUNNER_REGISTRATION_TOKEN=你的Token" > runner/.env
#
# 3. 启动 Runner
# docker compose -f docker-compose.runner.yaml up -d
#
# 4. 在 Gitea 仓库添加变量
# 访问https://git.fadinglight.cn/clz/billai/settings/actions/variables
# 添加 DEPLOY_PATH = /workspace/billai
#
# 模式说明:
# 使用 Docker 模式,每个 Job 会在 docker:latest 容器中执行
# 容器自带 docker CLI通过挂载 docker.sock 控制宿主机的 Docker
services:
runner:
image: gitea/act_runner:latest
container_name: billai-runner
restart: unless-stopped
env_file:
- ./runner/.env
environment:
GITEA_INSTANCE_URL: "https://git.fadinglight.cn"
GITEA_RUNNER_NAME: "billai-runner"
GITEA_RUNNER_LABELS: "self-hosted:docker://docker:latest,ubuntu-latest:docker://docker:latest"
CONFIG_FILE: /config.yaml
volumes:
# Runner 配置文件
- ./runner/config.yaml:/config.yaml
# Runner 数据持久化
- ./runner/data:/data
# Docker socket - Runner 通过它创建 Job 容器
- /var/run/docker.sock:/var/run/docker.sock
# 项目目录 - 挂载到 Runner 和 Job 容器都能访问的路径
- .:/workspace/billai