Skip to content

Commit

Permalink
delete old contents of staging folder and add slash to put files at r…
Browse files Browse the repository at this point in the history
…oot of folder
  • Loading branch information
GraemeFulton committed Apr 22, 2024
1 parent 8758796 commit 31e45e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ jobs:
# Add the server's host key to known_hosts
ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
scp -v -r ${{ env.STAGING_DIR_PATH }} ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }}:${{ env.STAGING_DIR_PATH }}
ssh -v ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} "
scp -r ${{ env.STAGING_DIR_PATH }}/ ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }}:${{ env.STAGING_DIR_PATH }}
ssh ${{ env.SERVER_USER }}@${{ env.SERVER_HOST }} "
set -e
echo "Cleaning staging directory..." | tee -a /var/log/prototypr/deploy.log
rm -rf ${{ env.STAGING_DIR_PATH }}/*
echo "Checking if live directory exists..." | tee -a /var/log/prototypr/deploy.log
if [ -d ${{ env.LIVE_DIR_PATH }} ]; then
echo "Moving live directory to backup..." | tee -a /var/log/prototypr/deploy.log
Expand Down

0 comments on commit 31e45e0

Please sign in to comment.