-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.35 KB
/
deploy.yml
File metadata and controls
48 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Health Check & Auto Deploy
on:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Backend Health Check (배포 후 확인)
health-check:
name: Backend Health Check
runs-on: ubuntu-latest
env:
BACKEND_HEALTH_URL: https://c-osine-backend-5z56.onrender.com/health
FRONTEND_URL: https://c-osine-frontend-5z56.onrender.com
steps:
- name: Wait for deployment
run: |
echo "⏳ Waiting 2 minutes for Render deployment..."
sleep 120
- name: Check backend health
run: |
echo "🏥 Checking backend health at $BACKEND_HEALTH_URL ..."
for i in {1..30}; do
if curl -f -s "$BACKEND_HEALTH_URL" > /dev/null 2>&1; then
echo "✅ Backend is healthy!"
exit 0
fi
echo "Attempt $i/30 failed, retrying in 10s..."
sleep 10
done
echo "❌ Backend health check failed after 5 minutes"
exit 1
- name: Check frontend availability
run: |
echo "🌐 Checking frontend at $FRONTEND_URL ..."
curl -f -s "$FRONTEND_URL" > /dev/null
echo "✅ Frontend is reachable"
- name: Deployment status
if: success()
run: echo "🎉 Deployment successful and healthy!"