Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,32 @@ jobs:
export IMAGE_NAME="${IMAGE_NAME}"
export IMAGE_TAG="${IMAGE_TAG}"
bash ${{ secrets.DEPLOY_SCRIPT_PATH }}


- name: Health Check
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.EC2_IP }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_KEY }}
script: |
sleep 5;
echo "Health Check 시작...🩺"

for i in {1..10}
do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" ${{ secrets.HEALTH_URL }})
if [ "$STATUS" -eq 200 ]; then
echo "✅ 서버 정상 응답 (HTTP 200)"
exit 0
fi

echo "⏳ 서버 기동 대기중... ($i/10)"
sleep 5
done

echo "❌ Health Check 실패"
exit 1

- name: CleanUp
if: always()
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spring:
show-sql: true
properties:
hibernate:
format_sql: true
format_sql: false
dialect: org.hibernate.dialect.MySQL8Dialect

config:
Expand All @@ -23,6 +23,9 @@ server:

logging:
config: classpath:logback-dev.xml
level:
org.hibernate.sql: DEBUG
org.hibernate.type.descriptor.sql: TRACE

auth:
jwt:
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ spring:
format_sql: true
dialect: org.hibernate.dialect.MySQL8Dialect

management:
endpoints:
web:
exposure:
include: health, info

server:
port: 9000

Expand Down