8
Service:GiteaRunner
Jeffery edited this page 2026-05-12 03:38:46 +00:00

安裝需要的套件

apt update && apt install -y nodejs

下載 Gitea Runner

wget https://gitea.com/gitea/runner/releases/download/v1.0.2/gitea-runner-1.0.2-linux-amd64 -O /usr/local/bin/runner

將 act_runner 設定為可執行檔

chmod +x /usr/local/bin/runner

註冊 Gitea Runner

設定參數

runner register

設計 Gitea Runner 服務

nano /etc/systemd/system/runner.service

服務檔內容

[Unit]
Description=Gitea Actions runner

[Service]
Environment=HOME=/root
Type=simple
WorkingDirectory=/root
ExecStart=/usr/local/bin/runner daemon
Restart=always
User=root

[Install]
WantedBy=multi-user.target

啟動服務

systemctl daemon-reload && systemctl enable runner.service && systemctl start runner.service && systemctl status runner.service

停止服務

systemctl stop act_runner.service && systemctl disable act_runner.service && rm /etc/systemd/system/act_runner.service