From eccc7bc0a585c215e60fc67a6a3468bd110f3981 Mon Sep 17 00:00:00 2001 From: zhizhi200271 Date: Fri, 24 Apr 2026 22:56:30 +0800 Subject: [PATCH] Create deploy.yml --- .github/workflows/deploy.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..2aa17a8b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 "🍂 秋秋的家部署完成!"