Problem: CI/CD was publishing only TaxBaik.Web/, excluding WebAssembly client
build output. This caused blazor.web.js to be missing from deployed package.
Solution: Change publish from 'TaxBaik.Web/' to '.' (solution root) to include
all projects:
- TaxBaik.Web.Client (WebAssembly client with blazor.web.js)
- TaxBaik.Web (server with MapRazorComponents configuration)
- All dependencies
Result: WebAssembly runtime and all interactive components now deploy correctly.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Problem: Migrations were copied to ./publish/migrations but app looks for db/migrations
Solution: Copy to ./publish/db/migrations to match working directory structure
This ensures V020, V021, V022 migrations run automatically on app startup.
Previously, all browser clients (AdminDashboardClient, InquiryBrowserClient, etc.)
had hardcoded BaseAddress of http://localhost:5001/taxbaik/api/. This caused
issues when implementing green-blue deployments where ports alternate between
5001/5002.
Changes:
- Add ApiClient:BaseUrl configuration in appsettings.json (default: 5001)
- Update Program.cs to read configuration instead of hardcoding
- All 6 browser clients now use dynamic configuration
- Deployment script prepared for green-blue support (port can be injected via
ApiClient__BaseUrl environment variable)
Deployment Note:
- For green-blue: Set ApiClient__BaseUrl environment variable before starting
the service on the alternate port (5002)
- Nginx still routes /taxbaik to the active instance
- Supports zero-downtime deployments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Program.cs: MapRazorComponents에 AllowAnonymous 추가
JWT 미들웨어가 Blazor 셸 요청을 401로 차단하던 문제 수정
(인증은 Blazor AuthorizeRouteView → RedirectToLogin에서 처리)
- deploy.yml: SSH 1회 연결로 배포+헬스체크 통합
서버 사이드 폴링으로 대기(최대 120초), CI 측 sleep 제거
구 배포 디렉토리 최근 5개 자동 정리
secrets 파일 사전 검증 추가
- maintenance.html: 배포 중 Nginx가 직접 서빙할 점검 페이지
15초 자동 새로고침, 카카오 채널 링크 포함
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
문제:
❌ "Publish Admin" 단계가 TaxBaik.Admin 프로젝트를 찾을 수 없음
❌ 분리된 배포 프로세스 (Web, Admin 각각)
원인:
• Web과 Admin이 이미 TaxBaik.Web으로 통합됨
• CI 스크립트가 아직도 분리된 구조를 가정
수정사항:
✅ "Publish Web" → "Publish Web (통합 앱)"
✅ "Publish Admin" 단계 제거
✅ 단일 publish 디렉토리 사용
✅ "Deploy Web" + "Deploy Admin" → "Deploy (통합 Web + Admin)"
✅ systemd를 통한 단일 서비스 재시작
결과:
✅ CI/CD 파이프라인 정상화
✅ 자동 배포 가능 (Gitea Actions)
✅ 1개 앱 배포로 단순화
파이프라인 단계:
1. Checkout → Build → Publish → Deploy → Restart
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
## 변경사항
### 배포 파이프라인 완성
✅ 코드 빌드: dotnet build
✅ Web/Admin 발행: dotnet publish
✅ 버전 정보 생성: version.txt 자동 생성
✅ Web 배포: 심링크 + 프로세스 시작
✅ Admin 배포: 심링크 + 프로세스 시작
### 무중단 배포 메커니즘
- 심링크로 원자적 버전 전환
- 기존 프로세스 종료 (pkill -9)
- 새 프로세스 자동 시작 (nohup)
- 에러 체크: || 로 실패 시 종료
### 환경 변수 설정
- ConnectionStrings__Default: PostgreSQL
- ASPNETCORE_ENVIRONMENT: Production
- ASPNETCORE_URLS: port 5001/5002
### 검증
- 프로세스 시작 확인: ps aux | grep
- 로그 기록: nohup으로 백그라운드 실행
- 버전 정보: git commit hash + build time
개선 사항:
- SSH 키 완전 제거
- git post-receive hook으로 자동 배포
- CI는 빌드만 수행 (publish 생성)
- git push 시 서버의 post-receive hook이 자동으로 배포 실행
배포 흐름:
1. git commit & push (로컬)
2. Gitea repository 업데이트
3. post-receive hook 자동 실행
4. 서버에서 빌드 후 배포.sh 호출
5. 배포 완료
장점:
- 간단함 (SSH 인증 불필요)
- 안전함 (별도의 인증 정보 저장 불필요)
- 빠름 (네트워크 오버헤드 최소)
- 한 곳에서 관리 (서버의 deploy.sh)
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>