Skip to content

Commit

Permalink
chore: 배포 스크립트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kariskan committed Aug 22, 2024
1 parent ad0ed6c commit 92ba827
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@ jobs:
PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }}
HOST: ${{ secrets.DEV_EC2_HOST }}
USER: ${{ secrets.DEV_EC2_USER }}
PATH: ${{ secrets.PATH }}
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
scp -o StrictHostKeyChecking=no -i private_key mono/build/libs/*.jar ${USER}@${HOST}:~/app.jar
scp -o StrictHostKeyChecking=no -i private_key ./build/libs/*.jar ${USER}@${HOST}:${PATH}
- name: EC2에서 JAR 실행
env:
PRIVATE_KEY: ${{ secrets.DEV_EC2_SSH_KEY }}
HOST: ${{ secrets.DEV_EC2_HOST }}
USER: ${{ secrets.DEV_EC2_USER }}
PATH: ${{ secrets.PATH }}
run: |
ssh -o StrictHostKeyChecking=no -i private_key ${USER}@${HOST} << EOF
pkill -f 'java -jar app.jar --spring.profiles.active=dev' || true
nohup java -jar app.jar --spring.profiles.active=dev > app.log 2>&1 &
cd ${PATH}
nohup java -jar *.jar --spring.profiles.active=dev > app.log 2>&1 &
EOF

0 comments on commit 92ba827

Please sign in to comment.