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