Files
taxbaik/.gitea/workflows/deploy.yml
T
kjh2064 4397983f93 최종 배포 구조 개선: SSH 제거, git hook 기반 배포
개선 사항:
- 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>
2026-06-26 17:40:30 +09:00

47 lines
1.3 KiB
YAML

name: TaxBaik CI/CD
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
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
run: |
cp -r db/migrations ./publish/web/migrations || true
cp -r db/migrations ./publish/admin/migrations || true
- name: Generate version 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 "✓ Build complete - Version: $COMMIT_HASH"