From 0864de6609ea0698188dc6672e1cc86261f3858d Mon Sep 17 00:00:00 2001 From: Souhail <101131126+centauridesigns@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:16:18 +0100 Subject: [PATCH] Update deploy.yml --- .github/workflows/deploy.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 92e4c0b..a00ebfa 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,11 +17,8 @@ jobs: chmod 600 ~/.ssh/id_ed25519 # This should be redundant but seems to do the trick. ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts - - name: Correct file permissions - run: sudo chown -R $USER:$USER . - - name: Connect, pull, build and deploy - run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && git checkout ${{ secrets.MAIN_BRANCH }} && git pull && docker compose down && docker compose up -d --build && exit" + run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && sudo chown -R $USER:$USER . && git checkout ${{ secrets.MAIN_BRANCH }} && git pull && docker compose down && docker compose up -d --build && exit" - name: Clean up run: rm -rf ~/.ssh