gitea+gitea runner ,兼容 GitHub Action 语法
参考写法
```yaml
services:
server:
image: gitea/gitea:latest
restart: always
ports:
- "3000:3000"
- "127.0.0.1:2222:22"
environment:
- USER_UID=998
- USER_GID=974
volumes:
- ./data:/data
- /home/git/.ssh/:/data/git/.ssh
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
runner:
image: gitea/act_runner:latest
restart: always
depends_on:
- server
ports:
- "8088:8088"
volumes:
- ./runner_data:/data
- ./runner_config.yaml:/config.yaml
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
environment:
- CONFIG_FILE=/config.yaml
- GITEA_INSTANCE_URL=[redacted]
- GITEA_RUNNER_REGISTRATION_TOKEN=[redacted]
- GITEA_RUNNER_NAME=default
```
其中 runner_config.yaml 是用于处理 cache 的,其内容类似于
```yaml
cache:
enabled: true
# dir: ""
# Use the LAN IP obtained in step 1
host: "10.10.10.12"
# Use the port number obtained in step 2
port: 8088
```
如果遇到问题可以参考
https://docs.gitea.com/zh-cn/usage/actions/overview 这里
另外有时候默认的标签会有问题,可以考虑修改./runner_data/.runner 里面的 labels 为
```json
"labels": [
"ubuntu-latest:docker://catthehacker/ubuntu:act-latest",
"ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04",
"ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04",
"ubuntu-18.04:docker://catthehacker/ubuntu:act-20.04"
]
```