- AppModule 注册 3 个 BullMQ Workers (AiAnalysis/DocumentImport/Notification) - Users 模块新增 GET/PATCH /users/me/profile 端点: - GET 读取 UserProfile (learningIdentity, learningDirection, bio, currentGoal) - PATCH upsert UserProfile - GET /users/me 返回 profile + preferences (include join) - 新增 RolesGuard + @Roles() 装饰器 (UserRole enum) - QueueModule/QueueService 改进 - 各模块 controller/repository/service 完善 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Deploy API Server
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout latest code
|
|
run: |
|
|
if [ -d /tmp/api-server ]; then
|
|
cd /tmp/api-server && git pull
|
|
else
|
|
git clone http://localhost:3000/suche-Hermes/api-server.git /tmp/api-server
|
|
fi
|
|
|
|
- name: Build Docker image
|
|
run: cd /tmp/api-server && docker build -t zhixi-api:latest .
|
|
|
|
- name: Stop old container
|
|
run: docker stop zhixi-api 2>/dev/null || true
|
|
|
|
- name: Remove old container
|
|
run: docker rm zhixi-api 2>/dev/null || true
|
|
|
|
- name: Start new container
|
|
run: |
|
|
docker run -d \
|
|
--name zhixi-api \
|
|
--network zhixi-net \
|
|
--restart unless-stopped \
|
|
-p 3001:3000 \
|
|
--env-file /etc/zhixi/.env.production \
|
|
zhixi-api:latest
|
|
|
|
- name: Health check
|
|
run: |
|
|
sleep 8
|
|
curl -f http://localhost:3001/health || (docker logs zhixi-api --tail 30 && exit 1)
|