From 66ad787bd57c757b4f4503c5f0299ac61174fa83 Mon Sep 17 00:00:00 2001 From: apogiatzis Date: Thu, 21 Nov 2024 23:55:57 +0000 Subject: [PATCH] fix: en na doulepsei oksa...? --- .github/workflows/push_image_deploy.yml | 29 ++++++++++--------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/push_image_deploy.yml b/.github/workflows/push_image_deploy.yml index 5cde989..5cf3c64 100644 --- a/.github/workflows/push_image_deploy.yml +++ b/.github/workflows/push_image_deploy.yml @@ -54,23 +54,17 @@ jobs: apt-get update && apt-get install -y sshpass sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no "$SSH_USER@$SSH_HOST" "mkdir -p ~/ovisbot" - - name: Upload Code to Server - env: - SSH_USER: ${{ secrets.SSH_USER }} - SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} - SSH_HOST: ${{ secrets.SSH_HOST }} - run: > - sshpass -p "$SSH_PASSWORD" rsync -avz --exclude '.git' ./ - "$SSH_USER@$SSH_HOST:~/ovisbot" - - - name: Deploy Application - env: - SSH_USER: ${{ secrets.SSH_USER }} - SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} - SSH_HOST: ${{ secrets.SSH_HOST }} - run: > - sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no - "$SSH_USER@$SSH_HOST" << 'EOF' + - name: Deploy to Server + uses: mai-space/action-sshpass-rsync@v1 + with: + host: ${{ secrets.SSH_HOST }} + user: ${{ secrets.SSH_USER }} + port: 22 + pass: ${{ secrets.SSH_PASS }} + local: "." + extra: "-avz --exclude '.git'" + remote: "~/ovisbot" + runAfterDeployment: | cd ~/ovisbot if [ -f docker-compose.yml ]; then docker compose -f docker-compose.yml -f docker-compose.prod.yml down || true @@ -80,4 +74,3 @@ jobs: echo "docker-compose.yml not found in the repository!" exit 1 fi - EOF