mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-14 13:06:51 +00:00
部署方式:服务器不再接收源码、不执行构建,改为本地构建成品后交付
- deploy-artifacts.sh:构建→备份→校验→原子替换,支持回滚、镜像/备份轮转、
mysql 与 postgres 双变体镜像;后端以 docker save|ssh|docker load 交付
- 依赖分组:requirements/{base,storage}.txt + db/{mysql,postgres,sqlite}.txt,
镜像按所选数据库只装对应驱动(MySQL 变体 565MB → 521MB)
编排与运行时加固
- compose:MySQL/Redis/backend 端口仅绑 127.0.0.1;密钥(SECRET_KEY、
DATA_ENCRYPTION_KEY、DATA_ENCRYPTION_OLD_KEYS)、PROD_CORS_ORIGINS、
FORWARDED_ALLOW_IPS、DEMO_ENABLE 一律由 docker/.env 注入
- Dockerfile:对齐依赖分组、以非 root(uid=1000) 运行;.dockerignore 排除全部真实 .env.*
- nginx:静态资源长缓存、隐藏文件拒绝、接口文档仅内网可访问、放行 ACME http-01 校验路径
工程基建
- 新增 CI:backend(uv sync + ruff + pytest)与 frontend(web type-check+vitest、app type-check)
- 新增 DEPLOYMENT.md 运维手册(部署/回滚/密钥轮换/每日巡检/证书/排查)
67 lines
1.3 KiB
YAML
67 lines
1.3 KiB
YAML
name: frontend
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "frontend/**"
|
|
- ".github/workflows/frontend-ci.yml"
|
|
pull_request:
|
|
paths:
|
|
- "frontend/**"
|
|
- ".github/workflows/frontend-ci.yml"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
web:
|
|
name: web(类型检查 + 单元测试)
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: frontend/web
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
cache-dependency-path: frontend/web/pnpm-lock.yaml
|
|
|
|
- name: 安装依赖
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: 类型检查
|
|
run: pnpm run type-check
|
|
|
|
- name: 单元测试
|
|
run: pnpm run test
|
|
|
|
app:
|
|
name: app(类型检查)
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: frontend/app
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: pnpm
|
|
cache-dependency-path: frontend/app/pnpm-lock.yaml
|
|
|
|
- name: 安装依赖
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: 类型检查
|
|
run: pnpm run type-check
|