Skip to content

Commit

Permalink
Update Cart-ci-cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeineb2001 authored Dec 27, 2024
1 parent 1b7492c commit 068e497
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/Cart-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ jobs:
run: |
sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" ssh ${{ secrets.DEPLOYMENT_MACHINE_USER }}@${{ secrets.DEPLOYMENT_MACHINE_IP }} \
"df -h && free -h && top -bn1 | grep 'Cpu(s)'"
- name: Kill Process on Port 8081 (if any)
run: |
sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" ssh ${{ secrets.DEPLOYMENT_MACHINE_USER }}@${{ secrets.DEPLOYMENT_MACHINE_IP }} \
"fuser -k 8081/tcp || echo 'No process on port 8081'"
- name: Deploy JAR to VPS
uses: appleboy/ssh-action@v0.1.2
with:
Expand All @@ -86,10 +91,10 @@ jobs:
script: |
sleep 10
echo "Starting Spring Boot service..."
echo "Starting java service..."
cd ~/Cart
nohup java -jar cart-project.jar --server.port=8081 > cart-project.log 2>&1 &
echo "Spring Boot service deployed successfully!"
echo "java service deployed successfully!"
sleep 30
Expand Down

0 comments on commit 068e497

Please sign in to comment.