架构: 添加CI/CD配置指南
This commit is contained in:
parent
3cc078e812
commit
1bee0619b4
35
architecture/ci-cd.md
Normal file
35
architecture/ci-cd.md
Normal file
@ -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. 镜像推送 → 服务器部署
|
||||
Loading…
Reference in New Issue
Block a user