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"