diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cfc8a01..428c248 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,16 +53,16 @@ jobs: - name: Build run: pnpm run build - - name: Deploy to Server # 第二步,rsync推文件 - uses: AEnterprise/rsync-deploy@v1.0 # 使用别人包装好的步骤镜像 - env: - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} # 引用配置,SSH私钥 - ARGS: -avz # rsync参数,排除.pyc文件 - SERVER_PORT: ${{ secrets.SSH_PORT }} # SSH端口 - FOLDER: ./dist # 要推送的文件夹,路径相对于代码仓库的根目录 - SERVER_IP: ${{ secrets.SSH_HOST }} # 引用配置,服务器的host名(IP或者域名domain.com) - USERNAME: ${{ secrets.SSH_USER }} # 引用配置,服务器登录名 - SERVER_DESTINATION: /root/project/awesome-study/ # 部署到目标文件夹 + - name: rsync deployments + uses: burnett01/rsync-deployments@5.2.1 + with: + switches: -avzr --delete + path: ./dist + remote_path: /root/project/awesome-study/ + remote_host: ${{ secrets.SSH_HOST }} + remote_port: ${{ secrets.SSH_PORT }} + remote_user: ${{ secrets.SSH_USER }} + remote_key: ${{ secrets.DEPLOY_KEY }} - name: Restart server # 第三步,重启服务 uses: appleboy/ssh-action@master