From c4c370eb1fa7c042095c9e77711334bcddc81ff7 Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Thu, 19 Dec 2024 13:32:38 +0700 Subject: [PATCH] fix: optimize ssh connect in the workflow reduces the overhead of an additional SSH connection. --- .github/workflows/deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f6b7ede..5902d67 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,5 +36,4 @@ jobs: key: ${{ secrets.SSH_PRIVATE_KEY_WEB_2 }} port: ${{ secrets.REMOTE_PORT_WEB_2 }} script: | - ssh ${{ vars.NGINX_SERVER_NAME }} "mkdir -p ${{ vars.NGINX_SERVER_DOCS_PATH }}" - rsync -avz --delete ${{ vars.DOCS_PATH_WEB_2 }}/build/ ${{ vars.NGINX_SERVER_NAME }}:${{ vars.NGINX_SERVER_DOCS_PATH }} + rsync -avz --delete -e "ssh ${{ secrets.NGINX_SERVER_NAME }}" ${{ vars.DOCS_PATH_WEB_2 }}/build/ ${{ vars.NGINX_SERVER_NAME }}:${{ vars.NGINX_SERVER_DOCS_PATH }}