Skip to content

Commit

Permalink
Update Deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jinseohyun1228 authored Nov 7, 2024
1 parent 01366eb commit 5718dbc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ jobs:
cd ~/Team11_BE # 프로젝트 디렉터리로 이동
git pull origin deploy # 배포 브랜치에서 업데이트
ps -ef | grep java | awk '{print $2}' | xargs kill -9 # 이전 Java 프로세스 종료
nohup java -jar build/libs/boomerang-0.0.1-SNAPSHOT.jar > log.txt 2>&1 & # 애플리케이션 실행
# 애플리케이션 프로퍼티 환경 변수 설정
export SPRING_APPLICATION_PROPERTIES=${{ secrets.APPLICATION }} # GitHub Secrets에서 가져오기
nohup java -jar -Dspring.config.location=${SPRING_APPLICATION_PROPERTIES} build/libs/boomerang-0.0.1-SNAPSHOT.jar > log.txt 2>&1 & # 애플리케이션 실행
EOF
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # SSH 비공개 키를 GitHub Secrets에 저장해두세요.

- name: Check log file
run: |
ssh -i "kwy-root.pem" ubuntu@ec2-52-79-80-3.ap-northeast-2.compute.amazonaws.com "tail -f ~/Team11_BE/log.txt" # 로그 파일 확인
ssh -i "kwy-root.pem" ubuntu@ec2-52-79-80-3.ap

0 comments on commit 5718dbc

Please sign in to comment.