Files
zhuangang/topics/devops/cicd/index.md
T

43 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: devops.cicd.index
title: CI/CD
type: index
domain: devops
stack: [cicd]
tags: [CI/CD, 持续集成, 持续部署, 流水线, 发布]
week: [3, 7, 14]
---
# CI/CD
持续集成(每次提交自动检查、测试、构建)和持续部署(自动发布到环境)。面试里常被问“你们的发布流程是怎样的”“出问题怎么回滚”。本专题以 GitHub Actions 语法为例(Gitea Actions 基本兼容,GitLab CI 思路相同),重点是流水线设计、发布策略和回滚,而不是某个平台的细节。
## 学习路线
| 顺序 | 课程 | 级别 | 预计 |
| --- | --- | --- | --- |
| 1 | [流水线设计:触发、阶段、缓存、服务容器、密钥](01-pipeline.md) | 基础 | 2 小时 |
| 2 | [发布与回滚:镜像标签、环境、滚动 / 蓝绿 / 金丝雀、数据库迁移](02-release-rollback.md) | 进阶 | 3 小时 |
## 企业场景
- [多语言仓库的流水线:Go + Python + 前端,按改动构建、自动部署和回滚](scenarios/multi-lang-pipeline.md)
## 面试题
- [CI/CD 面试题](interview.md)
## 示例代码
- [examples/pipeline](examples/pipeline/):`ci.yml`(GitHub Actions 语法的完整流水线)、`deploy.sh`(单机部署 + 健康检查 + 自动回滚,已用 shellcheck 检查)、`test_ci_config.py`(对流水线配置做结构检查)。流水线本身需要在 CI 平台上实际运行验证
## 在 16 周计划中
- [第 3 周:项目一 CI](../../../plan/week03-project1.md)、[第 7 周:前端构建](../../../plan/week07-frontend.md)、[第 14 周:部署](../../../plan/week14-backend-extend-deploy.md)
## 官方资料
- GitHub Actions:https://docs.github.com/actions
- Gitea Actions:https://docs.gitea.com/usage/actions/overview
- GitLab CI/CD:https://docs.gitlab.com/ci/