- /health + /ready 엔드포인트 추가 (DB/Redis 상태 확인) - RequestID 미들웨어 + 구조화 JSON 로깅 - 체인 트랜잭션 per-user rate limit (20 req/min) - DB 커넥션 풀 설정 (MaxOpen 25, MaxIdle 10, MaxLifetime 5m) - Graceful Shutdown 시 Redis/MySQL 연결 정리 - Dockerfile HEALTHCHECK 추가 - CI에 go vet + 빌드 검증 단계 추가 (deploy 전 실행) - 보스 레이드 클라이언트 입장 API (JWT 인증) - Player 프로필 모듈 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Server CI/CD
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
lint-and-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 코드 체크아웃
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Go 설치
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
|
|
- name: go vet 검증
|
|
run: go vet ./...
|
|
|
|
- name: 빌드 검증
|
|
run: go build -o /dev/null .
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: lint-and-build
|
|
steps:
|
|
- name: 서버에 배포
|
|
uses: appleboy/ssh-action@v1
|
|
with:
|
|
host: ${{ secrets.SERVER_HOST }}
|
|
username: ${{ secrets.SERVER_USER }}
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
port: 22
|
|
script: |
|
|
export PATH=$PATH:/usr/local/bin:/opt/homebrew/bin:$HOME/.docker/bin
|
|
cd /tmp
|
|
rm -rf a301-build
|
|
mkdir a301-build && cd a301-build
|
|
git clone https://tolelom:${{ secrets.GIT_TOKEN }}@git.tolelom.xyz/A301/a301_server.git a301_server
|
|
git clone https://github.com/tolelom/tolchain.git tolchain
|
|
docker build --no-cache -t a301-server:latest -f a301_server/Dockerfile .
|
|
cd ~/server
|
|
docker compose up -d --no-deps --force-recreate a301-server
|
|
rm -rf /tmp/a301-build
|