Skip to content

gitea action



# 配置gitea_runner

下载

mv act_runner /usr/local/bin

创建文件夹
mkdir /root/act_runner
mkdir /root/act_runner/act
mkdir /root/act_runner/cache
cd /root/act_runner

act_runner register --instance https://git.xx.com \
  --token xxx --no-interactive

生成配置文件
mkdir -p /etc/act_runner/




act_runner generate-config > /etc/act_runner/config.yaml # 生成配置文件

cat /etc/act_runner/config.yaml|egrep -v '^#|^$|  #'
--------config.yaml-------
log:
  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
  timeout: 3h
  insecure: false
  fetch_timeout: 5s
  fetch_interval: 2s
  labels:
    - "ubuntu-latest:docker://gitea/runner-images:ubuntu-latest"
    - "ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04"
    - "ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04"
cache:
  enabled: true
  dir: "/root/act_runner/cache"
  host: ""
  port: 0
  external_server: ""
container:
  network: ""
  privileged: false
  options:
  workdir_parent:
  valid_volumes: []
  docker_host: ""
  force_pull: true
  force_rebuild: false
host:
  workdir_parent: /root/act_runner/act

------config.yaml----------




/etc/systemd/system/gitea-runner.service

systemctl daemon-reload

systemctl start gitea-runner
systemctl enable gitea-runner


Description=Gitea Actions runner
Documentation=https://gitea.com/gitea/act_runner
After=docker.service

[Service]
Environment=PATH=/root/.nvm/versions/node/v20.17.0/bin:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/env/bin
ExecStart=/usr/local/bin/act_runner daemon -c /etc/act_runner/config.yaml
ExecReload=/bin/kill -s HUP
WorkingDirectory=/root/act_runner
NotifyAccess=all
User=root
Group=root
LimitNOFILE=65536

[Install]
WantedBy=default.target



cd /root/act_runner

act_runner register --instance https://git.wananai.com \
  --token xxx --no-interactive