From 3f3fa302ca41eeed9a05390fac76625bd33c3281 Mon Sep 17 00:00:00 2001 From: gushen610140 <--global> Date: Mon, 25 Aug 2025 15:05:01 +0800 Subject: [PATCH] feat: add action --- github/workflows/deploy.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 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 0000000..85d3891 --- /dev/null +++ b/github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: 构建并部署前端项目 + +on: + push: + branches: ["master"] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: 拉取代码 + uses: actions/checkout@v4 + + - name: 安装Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: 安装依赖 + run: bun install + + - name: 构建项目 + run: bun run build + + - name: 部署到服务器 + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SERVER_HOST }} + port: 22 + username: ${{ secrets.SERVER_USER }} + password: ${{ secrets.SERVER_PASSWORD }} + source: "dist/*" + target: ${{ secrets.SERVER_TARGET_DIR }} + rm: true