diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7153c7c..6e38500 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,17 +39,17 @@ jobs: sudo chmod 600 ../private.key echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts echo "${{ secrets.SSH_PASSPHRASE }}" | ssh-agent bash -c "\ - ssh-add ../private.key; ssh -o StrictHostKeyChecking=no -tt ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} '\ - cd ${{ env.SERVER_PATH }}/teamapp-backend && docker-compose down || \ - mkdir ${{ env.SERVER_PATH }} && cd ${{ env.SERVER_PATH }} && \ - git clone https://github.com/SoftBananas/teamapp-backend.git && \ - cd teamapp-backend && \ - echo "$ENV" > .env.prod; \ - git pull; \ - cd teamapp-backend; \ - docker-compose up -d; \ - exit \ - '" + ssh-add ../private.key && \ + ssh -o StrictHostKeyChecking=no -tt ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} '\ + cd ${{ env.SERVER_PATH }}/teamapp-backend && docker-compose down || \ + { mkdir -p ${{ env.SERVER_PATH }} && \ + cd ${{ env.SERVER_PATH }} && \ + git clone https://github.com/SoftBananas/teamapp-backend.git; } \ + cd teamapp-backend && \ + echo \"$ENV\" > .env.prod && \ + git pull && \ + docker-compose up -d); \ + exit'" shell: bash env: