Merge branch 'feature/TaxBaik-배포-완성'

## 변경사항 요약
TaxBaik 배포 시스템을 최종 완성하고 모든 구성 요소를 통합했습니다.

### 완성된 기능
 전체 배포 파이프라인
 systemd 서비스 관리
 Nginx 라우팅 설정
 PostgreSQL 데이터베이스 연결
 Gitea Actions CI/CD

### 배포 환경
- Server: 178.104.200.7
- Web: http://178.104.200.7:5001 (Nginx: /taxbaik)
- Admin: http://178.104.200.7:5002 (Nginx: /taxbaik/admin)
- Database: PostgreSQL 18

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 18:40:50 +09:00
+72 -3
View File
@@ -6,8 +6,77 @@ on:
- master - master
jobs: jobs:
trigger-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Trigger deployment webhook - name: Checkout code
run: echo "✓ CI triggered - server will deploy via git hook" uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0'
- name: Restore dependencies
run: dotnet restore TaxBaik.sln
- name: Build solution
run: dotnet build TaxBaik.sln -c Release --no-restore
- name: Publish Web
run: dotnet publish TaxBaik.Web/ -c Release -o ./publish/web
- name: Publish Admin
run: dotnet publish TaxBaik.Admin/ -c Release -o ./publish/admin
- name: Copy migrations to publish
run: |
cp -r db/migrations ./publish/web/migrations || true
cp -r db/migrations ./publish/admin/migrations || true
- name: Generate build info
run: |
mkdir -p ./publish/web/wwwroot ./publish/admin/wwwroot
COMMIT_HASH=$(git rev-parse --short HEAD)
BUILD_TIME=$(date -u +'%Y-%m-%d %H:%M:%S UTC')
echo "Version: $COMMIT_HASH" > ./publish/web/wwwroot/version.txt
echo "Built: $BUILD_TIME" >> ./publish/web/wwwroot/version.txt
cp ./publish/web/wwwroot/version.txt ./publish/admin/wwwroot/version.txt
echo "✓ Version files created"
- name: Deploy Web
run: |
set -e
WEB_TIMESTAMP=$(date +%Y%m%d_%H%M%S)
DEPLOY_HOME="/home/kjh2064"
WEB_DEPLOY_DIR="$DEPLOY_HOME/deployments/taxbaik_${WEB_TIMESTAMP}"
echo "=== Deploying Web (v$(git rev-parse --short HEAD)) ==="
mkdir -p "$WEB_DEPLOY_DIR"
cp -r ./publish/web "$WEB_DEPLOY_DIR/"
ln -sfn "$WEB_DEPLOY_DIR/web" "$DEPLOY_HOME/taxbaik_active"
echo "✓ Web deployed"
- name: Deploy Admin
run: |
set -e
ADMIN_TIMESTAMP=$(date +%Y%m%d_%H%M%S)
DEPLOY_HOME="/home/kjh2064"
ADMIN_DEPLOY_DIR="$DEPLOY_HOME/deployments/taxbaik_admin_${ADMIN_TIMESTAMP}"
echo "=== Deploying Admin (v$(git rev-parse --short HEAD)) ==="
mkdir -p "$ADMIN_DEPLOY_DIR"
cp -r ./publish/admin "$ADMIN_DEPLOY_DIR/"
ln -sfn "$ADMIN_DEPLOY_DIR/admin" "$DEPLOY_HOME/taxbaik_admin_active"
echo "✓ Admin deployed"
- name: Restart services
run: |
echo "=== Restarting services ==="
pkill -9 -f "TaxBaik.Web" || echo "No Web process to kill"
pkill -9 -f "TaxBaik.Admin" || echo "No Admin process to kill"
sleep 2
echo "=== Services will restart automatically via systemd ==="
echo "✓ Deployment complete"