From d34f0de7d5d958ea2df1f0d3373d99a2ce442454 Mon Sep 17 00:00:00 2001 From: bingshuo <565183519@qq.com> Date: Wed, 20 May 2026 01:35:51 +0800 Subject: [PATCH] feat: auto-update workflow --- .gitea/workflows/auto-update.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .gitea/workflows/auto-update.yaml diff --git a/.gitea/workflows/auto-update.yaml b/.gitea/workflows/auto-update.yaml new file mode 100644 index 0000000..325c644 --- /dev/null +++ b/.gitea/workflows/auto-update.yaml @@ -0,0 +1,22 @@ +name: 自动更新代码和重启 +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + update-and-restart: + runs-on: ubuntu + steps: + - name: 同步代码并重启 + run: | + cd /data/guanghulab/repo + git fetch origin + git reset --hard origin/main + cd /data/guanghulab/repo/server/mcp-server + npm install --production 2>/dev/null || true + pm2 restart guanghulab-mcp-server + cp /data/guanghulab/repo/homepage/fetch_train.py /opt/guanghulab-repo/homepage/fetch_train.py + cd /opt/guanghulab-repo/homepage + python3 fetch_train.py + echo "DONE"