Files
gitea_actions/config.yaml
编码猿 7acf000234
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
33344
2025-10-05 02:16:12 +08:00

112 lines
4.7 KiB
YAML
Raw 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.

# Example configuration file, it's safe to copy this as the default config file without any modification.
# You don't have to copy this file to your instance,
# just run `./act_runner generate-config > config.yaml` to generate a config file.
log:
# 日志级别可选值trace, debug, info, warn, error, fatal
level: info
runner:
# 注册结果存储位置
file: .runner
# 同时执行的任务并发数
capacity: 1
# 运行作业的额外环境变量
envs:
A_TEST_ENV_NAME_1: a_test_env_value_1
A_TEST_ENV_NAME_2: a_test_env_value_2
# 从文件加载额外环境变量
# 如果为空或文件不存在则忽略
env_file: .env
# 作业完成的超时时间
# 注意Gitea 实例也有作业超时设置默认3小时
# 如果 Gitea 的超时时间更短,作业可能会被 Gitea 停止
timeout: 3h
# 关闭时等待运行中作业完成的超时时间
# 在此超时后仍未完成的运行中作业将被取消
shutdown_timeout: 0s
# 是否跳过验证 Gitea 实例的 TLS 证书
insecure: false
# 从 Gitea 实例获取作业的超时时间
fetch_timeout: 5s
# 从 Gitea 实例获取作业的间隔时间
fetch_interval: 2s
# 用于指定拉取 action 仓库的 GitHub 镜像地址
# 当使用类似 `uses: actions/checkout@v4` 且 DEFAULT_ACTIONS_URL 设置为 github 时生效
# 如果 github_mirror 不为空,会将 https://github.com 替换为此处的值
# 这对某些特殊网络环境很有用
github_mirror: ''
# runner 的标签用于确定可以运行哪些作业以及如何运行它们
# 例如:"macos-arm64:host" 或 "ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
# 在 https://gitea.com/docker.gitea.com/runner-images 查找 Gitea 提供的更多镜像
# 注册时如果为空,会要求输入标签
# 执行 `daemon` 时如果为空,将使用 `.runner` 文件中的标签
labels:
- "ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
- "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
- "ubuntu-20.04:docker://docker.gitea.com/runner-images:ubuntu-20.04"
# 作用:配置 Actions 缓存功能,加速依赖下载和构建过程
cache:
# 启用缓存服务器以使用 actions/cache
enabled: true
# 存储缓存数据的目录
# 如果为空,缓存数据将存储在 $HOME/.cache/actcache
dir: ""
# 缓存服务器的主机地址
# 这不是监听地址,而是作业容器连接的地址
# 因此 0.0.0.0 是个不好的选择,留空以自动检测
host: ""
# 缓存服务器的端口
# 0 表示使用随机可用端口
port: 0
# 外部缓存服务器 URL。仅在 enable 为 true 时有效
# 如果指定act_runner 将使用此 URL 作为 ACTIONS_CACHE_URL 而不是自行启动服务器
# URL 通常应以 "/" 结尾
external_server: ""
container:
# 指定容器将连接到的网络
# 可以是 host、bridge 或自定义网络名称
# 如果为空act_runner 将自动创建网络
network: ""
# 启动任务容器时是否使用特权模式Docker-in-Docker 需要特权模式)
privileged: false
# 启动容器时使用的其他选项(例如 --add-host=my.gitea.url:host-gateway
options:
# 作业工作目录的父目录
# 注意:不需要在路径开头添加 '/'act_runner 会自动添加
# 如果路径以 '/' 开头,'/' 将被修剪
# 例如,如果父目录是 /path/to/my/dirworkdir_parent 应该是 path/to/my/dir
# 如果为空,将使用 /workspace
workdir_parent:
# 可以挂载到容器的卷(包括绑定挂载)。支持 glob 语法
# 您可以指定多个卷。如果序列为空,则不能挂载任何卷
# 例如,如果只允许容器挂载 `data` 卷和 /src 中的所有 json 文件,配置应为:
# valid_volumes:
# - data
# - /src/*.json
# 如果要允许任何卷,请使用以下配置:
# valid_volumes:
# - '**'
valid_volumes: []
# 使用指定的 docker 客户端主机覆盖默认值
# 如果为空act_runner 将自动查找可用的 docker 主机
# 如果是 "-"act_runner 将自动查找可用的 docker 主机,但 docker 主机不会挂载到作业容器和服务容器
# 如果不为空也不是 "-",将使用指定的 docker 主机。如果不起作用将返回错误
docker_host: ""
# 即使已存在也拉取 docker 镜像
force_pull: true
# 即使已存在也重新构建 docker 镜像
force_rebuild: false
# 始终要求可访问的 docker 守护进程,即使 act_runner 不需要
require_docker: false
# 如果 docker 被 require_docker 或 act_runner 需要,等待 docker 守护进程可访问的超时时间
docker_timeout: 0s
host:
# 作业工作目录的父目录
# 如果为空,将使用 $HOME/.cache/act/
workdir_parent: