From c4f3235fcf2cdeb2bfe2480c96de92ad488123e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=82=A0=E5=B1=B1?= <17738440858@163.com> Date: Mon, 2 Mar 2026 15:53:48 +0800 Subject: [PATCH] feat: add CI/CD auto deploy workflow --- .gitea/workflows/deploy.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..66ee141 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Auto Deploy + +on: + push: + branches: + - wuxichen # 当前分支 + - main + - master + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Install dependencies + run: pnpm install + + - name: Build project + run: pnpm build + + - name: Deploy to server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + source: "dist/*" + target: ${{ secrets.DEPLOY_PATH }} + strip_components: 1