feat: auto-update workflow
This commit is contained in:
parent
b1a5a1306f
commit
d34f0de7d5
22
.gitea/workflows/auto-update.yaml
Normal file
22
.gitea/workflows/auto-update.yaml
Normal file
@ -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"
|
||||||
Loading…
x
Reference in New Issue
Block a user