From 2fa071faeaa23105eb5313d9a6a3be338ff351cc Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 13 Feb 2026 13:52:57 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20Service=EF=BC=9AGiteaRunne?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service%EF%BC%9AGiteaRunner.md | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 Service%EF%BC%9AGiteaRunner.md diff --git a/Service%EF%BC%9AGiteaRunner.md b/Service%EF%BC%9AGiteaRunner.md new file mode 100644 index 0000000..f2f9c7b --- /dev/null +++ b/Service%EF%BC%9AGiteaRunner.md @@ -0,0 +1,62 @@ +# 下載 Gitea Runner + +```bash +wget https://gitea.com/gitea/act_runner/releases/download/v0.2.13/act_runner-0.2.13-linux-amd64 -O /usr/local/bin/act_runner +``` + +將 act_runner 設定為可執行檔 + +```bash +chmod +x /usr/local/bin/act_runner +``` + +# 註冊 Gitea Runner + +設定參數 + +```bash +GITEA_URL='https://gitea.jsc.idv.tw' +``` + +```bash +REGISTER_TOKEN='SsbiLdBK5icOPcmrFgt78XAkOyu2lWSZRQbr5D21' +``` + +```bash +RUNNER_LABELS='ct-docker' +``` + +```bash +RUNNER_NAME='ct-docker' +``` + +```bash +act_runner register --no-interactive --instance $GITEA_URL --token $REGISTER_TOKEN --labels $RUNNER_LABELS --name $RUNNER_NAME +``` + +# 設計 Gitea Runner 服務 + +```bash +nano /etc/init.d/act_runner +``` + +服務檔內容 + +```ini +#!/sbin/openrc-run + +name="Gitea Actions runner" +command="/usr/local/bin/act_runner daemon" +command_background=true +pidfile="/run/${name}.pid" + +depend() { + need net +} +``` + +啟動服務 + +```bash +rc-update add act_runner && rc-service act_runner start && rc-service act_runner status +``` \ No newline at end of file