ci: enhance deployment health checks with resource validation
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m16s

- Add CSS file load verification (/taxbaik/css/admin.css)
- Add version.json file existence check
- Add admin login page load test (/taxbaik/admin/login)
- Fail deployment if any validation fails
- Prevent deployment with missing critical resources

This harness ensures common issues are caught immediately after deployment:
- CSS path problems (resolved in previous commits)
- Missing version info (resolved in previous commits)
- Admin page rendering issues

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-28 10:02:16 +09:00
parent 640ea96ae7
commit 114ab22197
+25
View File
@@ -134,6 +134,31 @@ jobs:
for i in \$(seq 1 \$ATTEMPTS); do
STATUS=\$(curl -sf -o /dev/null -w '%{http_code}' http://127.0.0.1:5001/taxbaik/ 2>/dev/null || echo "000")
if [ "\$STATUS" = "200" ]; then
echo "✓ [1/4] 메인 페이지 로드 완료"
# 검증 1: CSS 파일 로드
CSS_STATUS=\$(curl -sf -o /dev/null -w '%{http_code}' http://127.0.0.1:5001/taxbaik/css/admin.css 2>/dev/null || echo "000")
if [ "\$CSS_STATUS" != "200" ]; then
echo "❌ CSS 파일 로드 실패 (상태: \$CSS_STATUS)" >&2
exit 1
fi
echo "✓ [2/4] CSS 파일 로드 완료"
# 검증 2: 버전 정보
if [ ! -s "\$DEPLOY_DIR/wwwroot/version.json" ]; then
echo "❌ version.json 누락" >&2
exit 1
fi
echo "✓ [3/4] 버전 정보 확인 완료"
# 검증 3: 관리자 로그인 페이지
LOGIN_STATUS=\$(curl -sf -o /dev/null -w '%{http_code}' http://127.0.0.1:5001/taxbaik/admin/login 2>/dev/null || echo "000")
if [ "\$LOGIN_STATUS" != "200" ]; then
echo "❌ 관리자 로그인 페이지 로드 실패 (상태: \$LOGIN_STATUS)" >&2
exit 1
fi
echo "✓ [4/4] 관리자 페이지 로드 완료"
echo "✓ 서비스 정상 (시도 \$i/\$ATTEMPTS)"
# 구 배포 디렉토리 정리 (최근 5개 보존)
ls -1dt \$DEPLOY_HOME/deployments/taxbaik_* 2>/dev/null \