Skip to content

Commit

Permalink
ci: Delete dist folder on server if it exists before deployment.
Browse files Browse the repository at this point in the history
  • Loading branch information
danimalweb committed Jan 4, 2024
1 parent f266f1a commit bd6c55d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ jobs:
run: |
echo "${{ secrets.DEPLOY_KEY }}" > deploy_key
chmod 600 ./deploy_key
# Deleting 'dist' folder on the server if it exists
echo "Checking and deleting 'dist' folder on the server if it exists..."
ssh -i ./deploy_key -o StrictHostKeyChecking=no ${{ steps.dotenv.outputs.SSH_LOGIN }} 'if [ -d "${{ steps.dotenv.outputs.DEPLOYMENT_PATH }}${{ steps.dotenv.outputs.VITE_THEME_PATH }}/dist" ]; then rm -rf ${{ steps.dotenv.outputs.DEPLOYMENT_PATH }}${{ steps.dotenv.outputs.VITE_THEME_PATH }}/dist; fi'
# Starting rsync operation
echo "Starting rsync operation..."
rsync -chav --delete \
-e 'ssh -i ./deploy_key -o StrictHostKeyChecking=no' \
--exclude-from='.git-ftp-ignore' \
Expand Down

0 comments on commit bd6c55d

Please sign in to comment.