Skip to content

Commit

Permalink
changes in deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
farooqpk committed Sep 17, 2024
1 parent 1b09427 commit 07be58a
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,14 @@ jobs:
key: ${{ secrets.VPS_SSH_KEY }}
debug: true
script: |
echo "Starting deployment to VPS..."
echo "Copying docker-compose.yml to VPS..."
pwd
ls -la
echo "Continuing with deployment..."
echo "Copying docker-compose.yml and nginx.conf to VPS..."
scp -o StrictHostKeyChecking=no ./docker-compose.yml ./nginx/default.conf ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }}:/home/${{ secrets.VPS_USERNAME }}/app/
echo "Restarting Docker containers on the VPS..."
ssh -o StrictHostKeyChecking-no ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }} '
cd /home/${{ secrets.VPS_USERNAME }}/app &&
docker-compose down &&
docker-compose pull &&
docker-compose up -d --build &&
echo "Docker containers restarted successfully."
echo "Starting deployment to VPS..."
pwd
ls -la
echo "Copying files and restarting Docker containers..."
scp -o StrictHostKeyChecking=no ./docker-compose.yml ./nginx/default.conf /home/${{ secrets.VPS_USERNAME }}/app/
cd /home/${{ secrets.VPS_USERNAME }}/app
docker-compose down
docker-compose pull
docker-compose up -d --build
echo "Deployment completed successfully."
'

0 comments on commit 07be58a

Please sign in to comment.