From 2576dd04bf7a3bab9fc07598f4b66a0ddaae27a1 Mon Sep 17 00:00:00 2001 From: log101 Date: Tue, 14 May 2024 16:22:18 +0000 Subject: [PATCH] add rsync to workflow --- .gitea/workflows/astro-deploy.yaml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/astro-deploy.yaml b/.gitea/workflows/astro-deploy.yaml index 8786c4f..2e8b51d 100644 --- a/.gitea/workflows/astro-deploy.yaml +++ b/.gitea/workflows/astro-deploy.yaml @@ -44,15 +44,21 @@ jobs: run: | ${{ steps.detect-package-manager.outputs.runner }} astro build working-directory: ${{ env.BUILD_PATH }} - - name: Transfer dist folder - run: scp -r ./dist log101@log101.dev:/home/log101/ - - name: executing remote ssh commands using ssh key - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - script: | - whoami - ls -l ${{ env.BUILD_PATH }}/dist + - name: Deploy to my server + uses: up9cloud/action-rsync@master + env: + HOST: ${{ secrets.HOST }} + KEY: ${{ secrets.KEY }} + TARGET: ${{ secrets.DESTINATION_FOLDER }} + + VERBOSE: true + USER: ${{ secrets.USERNAME }} + ARGS: -az --exclude=/.git/ + SSH_ARGS: '-p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' + SOURCE: ./dist/ + + PRE_SCRIPT: | + echo start at: + date -u + POST_SCRIPT: "echo done at: && date -u" +