Skip to content

Commit

Permalink
Fix deployment script to delete App folder if it exists before copyin…
Browse files Browse the repository at this point in the history
…g code to VM
  • Loading branch information
AnkanSaha committed Apr 7, 2024
1 parent 785af5a commit 0fb7d72
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ jobs:
run: |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > private_key.pem
chmod 600 private_key.pem
- name: Check if App folder exists and delete if it does
run: |
ssh -i private_key.pem ${{ secrets.USERNAME }}@${{ secrets.VM_IP }} '[ -d ~/App ] && rm -rf ~/App || true'
- name: Copy code to VM
run: |
sudo scp -o StrictHostKeyChecking=no -i private_key.pem -r ./* ${{ secrets.USERNAME }}@${{ secrets.VM_IP }}:~/ # Copies all files and directories to the home directory of the user on VM
sudo scp -o StrictHostKeyChecking=no -i private_key.pem -r ./* ${{ secrets.USERNAME }}@${{ secrets.VM_IP }}:~/App # Copies all files and directories to the home directory of the user on VM
- name: Clean Up
run: |
Expand Down

0 comments on commit 0fb7d72

Please sign in to comment.