Create deploy.yml

This commit is contained in:
zhizhi200271 2026-04-24 22:56:30 +08:00 committed by GitHub
parent 684f9fc975
commit eccc7bc0a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 28 additions and 0 deletions

28
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: 部署秋秋的家
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 拉取代码
uses: actions/checkout@v3
- name: 部署到服务器
uses: appleboy/ssh-action@master
with:
host: $ secrets.ZZ_SERVER_HOST
username: $ secrets.ZZ_SERVER_USER
key: $ secrets.ZZ_SERVER_KEY
script: |
cd $ secrets.ZZ_SERVER_PATH /qiuqiu || mkdir -p $ secrets.ZZ_SERVER_PATH /qiuqiu && cd $ secrets.ZZ_SERVER_PATH /qiuqiu
git pull origin main || git clone https://github.com/zhizhi200271/guanghulab.git .
npm install
export ZZ_LLM_API_KEY=$ secrets.ZZ_LLM_API_KEY
export ZZ_LLM_BASE_URL=$ secrets.ZZ_LLM_BASE_URL
pm2 restart qiuqiu || pm2 start server.js --name qiuqiu --env production
pm2 save
echo "🍂 秋秋的家部署完成!"