diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bea6ae885..42d1586b1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,12 +28,11 @@ jobs: hugo -D --minify - name: Deploy to Server # 第四步,rsync推文件 - uses: AEnterprise/rsync-deploy@v1.0 # 使用别人包装好的步骤镜像 - env: - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} # 引用配置,SSH私钥 - ARGS: -avz --delete --exclude='*.pyc' # rsync参数,排除.pyc文件 - SERVER_PORT: '22' # SSH端口 - FOLDER: ./website/public/* #推送的文件夹,路径相对于代码仓库的根目录 - SERVER_IP: ${{ secrets.SSH_HOST }} # 引用配置,服务器的host名(IP或者域名domain.com) - USERNAME: ${{ secrets.SSH_USERNAME }} # 引用配置,服务器登录名 - SERVER_DESTINATION: /var/www/books/leetcode/ # 部署到目标文件夹 + uses: appleboy/ssh-action@v0.1.3 # 使用别人包装好的步骤镜像 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.DEPLOY_KEY }} + port: ${{ secrets.SERVER_PORT }} + script: | + rsync -avz --delete --exclude='*.pyc' ./website/public/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.SERVER_DESTINATION }}