Skip to content

Commit

Permalink
build: 배포 과정 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
nuyh99 committed Nov 27, 2023
1 parent 2e8e81c commit e90caf0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,24 @@ jobs:
host: ${{ secrets.HOST }}
username: 'ubuntu'
key: ${{ secrets.PRIVATE_KEY }}
script: /home/ubuntu/server/deploy.sh
script: |
cd /home/ubuntu/server
if sudo lsof -i :8080;
then
echo "Port 8080 is already in use. Killing the process..."
sudo lsof -i :8080 | awk 'NR!=1 {print $2}' | sudo xargs kill -9
fi
while lsof -i :8080
do
echo "Wait for killing prior process..."
sleep 1
done
echo "Start Spring..."
sudo nohup java -jar -Dspring.profiles.active=prod -Duser.timezone=Asia/Seoul busan-0.0.1-SNAPSHOT.jar > nohup.out 2> nohup.err < /dev/null &
echo "Finished!"
- name: Docker build and push
run: |
Expand Down

0 comments on commit e90caf0

Please sign in to comment.