Skip to content

Commit 258c562

Browse files
committed
chore: jar 파일 경로 수정3
1 parent 14a3f5a commit 258c562

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
host: ${{ secrets.EC2_HOST }}
3434
username: ${{ secrets.EC2_USER }}
3535
key: ${{ secrets.EC2_SSH_KEY }}
36-
source: "build/libs/*.jar"
37-
target: "/home/ubuntu/app/app.jar"
36+
source: "build/libs/*-SNAPSHOT.jar"
37+
target: "/home/ubuntu/app"
3838
overwrite: true
3939

4040
# 5) EC2에서 앱 재시작
@@ -46,10 +46,18 @@ jobs:
4646
key: ${{ secrets.EC2_SSH_KEY }}
4747
script: |
4848
cd /home/ubuntu/app
49-
50-
pkill -f "java -jar app.jar" || true
49+
50+
pkill -f "java -jar" || true
5151
sleep 5
5252
53+
JAR_PATH=$(ls -t build/libs/*-SNAPSHOT.jar | head -n 1)
54+
echo "Using JAR: $JAR_PATH"
55+
56+
if [ -z "$JAR_PATH" ]; then
57+
echo "No JAR found under build/libs"
58+
exit 1
59+
fi
60+
5361
export DB_PASSWORD='${{ secrets.DB_PASSWORD }}'
54-
55-
nohup java -jar app.jar > app.log 2>&1 &
62+
63+
nohup java -jar "$JAR_PATH" > app.log 2>&1 &

0 commit comments

Comments
 (0)