diff --git a/architecture/ci-cd.md b/architecture/ci-cd.md new file mode 100644 index 0000000..c8397fe --- /dev/null +++ b/architecture/ci-cd.md @@ -0,0 +1,35 @@ +# CI/CD 流程配置 + +## GitHub Actions + +```yaml +name: CI/CD + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + - name: Install dependencies + run: | + cd backend && npm install + cd ../frontend && npm install + - name: Run tests + run: npm test +``` + +## 部署流程 + +1. 代码提交 → 自动测试 +2. 测试通过 → 构建镜像 +3. 镜像推送 → 服务器部署