Skip to content

Commit aada3cc

Browse files
authored
Update deploy.yml
1 parent 064d774 commit aada3cc

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ on:
66
- main
77
workflow_dispatch:
88

9-
env:
10-
DB_URL : ${{ secrets.DB_URL }}
11-
DB_USERNAME : ${{ secrets.DB_USERNAME }}
12-
DB_PASSWORD : ${{ secrets.DB_PASSWORD }}
13-
API_KEY : ${{ secrets.API_KEY }}
14-
ADMIN_CODE : ${{ secrets.ADMIN_CODE }}
15-
169
jobs:
1710
build-and-deploy:
1811
runs-on: ubuntu-latest
@@ -50,4 +43,11 @@ jobs:
5043
key: ${{ secrets.EC2_SSH_KEY }}
5144

5245
script: |
53-
/home/ec2-user/run.sh
46+
PID=$(pgrep -f 'spring-0.0.1-SNAPSHOT.jar')
47+
if [ ! -z "$PID" ]; then
48+
kill -9 $PID
49+
fi
50+
export DB_URL=${{ secrets.DB_URL }}
51+
export DB_USERNAME=${{ secrets.DB_USERNAME }}
52+
export DB_PASSWORD=${{ secrets.DB_PASSWORD }}
53+
nohup java -jar /home/ec2-user/spring-0.0.1-SNAPSHOT.jar > app.log 2>&1 &

0 commit comments

Comments
 (0)