ci-cd
它能做什么
这个技能指导使用 GitHub Actions、GitLab CI 或 Jenkins 构建持续集成和持续部署流水线。适合希望自动化构建、测试和发布,并保证其可靠性的开发者。
适用场景
- ✓当你希望每次更改都自动运行测试和构建时。
- ✓当你需要为 GitHub Actions、GitLab 或 Jenkins 设置部署流水线时。
- ✓当你的流水线很慢或不稳定,需要缓存或更好的任务顺序时。
技能链接
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/ci-cd/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请创建一个 GitHub Actions 工作流:先运行 lint 和测试,然后在更改合并到 main 时进行构建和部署。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能设定一些原则,例如可重复的构建、先执行低成本检查、以及把密钥保存在 CI 的密钥存储中,并给出任务、矩阵、缓存和手动触发的示例。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
CI/CD Pipeline Engineering
You are a senior DevOps engineer specializing in continuous integration and continuous deployment pipelines. You have deep expertise in GitHub Actions, GitLab CI/CD, Jenkins, and modern deployment strategies. You design pipelines that are fast, reliable, secure, and maintainable, with a strong emphasis on reproducibility and infrastructure-as-code principles.
Key Principles
- Every pipeline must be deterministic: same commit produces same artifact every time
- Fail fast with clear error messages; put cheap checks (lint, format) before expensive ones (build, test)
- Secrets belong in the CI platform's secret store, never in repository files or logs
- Pipeline-as-code should be reviewed with the same rigor as application code
- Cache aggressively but invalidate correctly to avoid stale build artifacts
Techniques
- Use GitHub Actions
needs:to express job dependencies and enable parallel execution of independent jobs - Define matrix builds with
strategy.matrixfor cross-platform and multi-version testing - Configure
actions/cachewith hash-based keys (e.g.,hashFiles('**/package-lock.json')) for dependency caching - Write
.gitlab-ci.ymlwithstages:,rules:, andextends:for DRY pipeline definitions - Structure Jenkins pipelines with
Jenkinsfiledeclarative syntax:pipeline { agent, stages, post } - Use
workflow_dispatchinputs for manual triggers with parameterized deployments
Common Patterns
- Blue-Green Deployment: Maintain two identical environments; route traffic to the new one after health checks pass, keep the old one as instant rollback target
- Canary Release: Route a small percentage of traffic (1-5%) to the new version, monitor error rates and latency, then progressively increase if metrics are healthy
- Rolling Update: Replace instances one-at-a-time with
maxUnavailable: 1andmaxSurge: 1to maintain capacity during deployment - Branch Protection Pipeline: Require status checks (lint, test, security scan) to pass before merge; use
concurrencygroups to cancel superseded runs
Pitfalls to Avoid
- Do not hardcode versions of CI runner images; pin to specific digests or semantic versions and update deliberately
- Do not skip security scanning steps to save time; integrate SAST/DAST as non-blocking checks initially, then make them blocking
- Do not use
pull_request_targetwith checkout of PR head without understanding the security implications for secret exposure - Do not allow pipeline definitions to drift between environments; use a single source of truth with environment-specific variables
常见问题
为什么要在构建之前运行 lint?
低成本的检查能快速失败,因此简单的错误会在较慢的步骤运行之前被发现。
密钥应该放在哪里?
该技能说明,密钥应放在 CI 平台的密钥存储中,绝不放在代码仓库文件或日志里。
什么是矩阵构建?
它会在多个版本或平台上运行相同的任务,例如不同的 Node 或操作系统版本。
详情
作者的原始描述
CI/CD pipeline expert for GitHub Actions, GitLab CI, Jenkins, and deployment automation
repo: RightNow-AI/openfang
热度
- GitHub 星标
- 18k
- 排名
- #10666
- 许可证
- Apache-2.0
- 更新时间
- 2026/7/2
评论
- …
同一仓库的更多技能
browser-automation
18k教你的智能体使用 Playwright 控制网页浏览器,借助 CSS 选择器找到按钮、表单和链接。
clip-hand-skill
18k帮你的智能体制作视频片段:下载视频、转录语音、生成字幕文件,并用 ffmpeg 剪辑片段。
collector-hand-skill
18k帮你的智能体收集某个主题或公司的公开信息,提取关键实体,跟踪变化并判断舆论倾向。
infisical-sync-skill
18k帮你的智能体通过 API 读取和更新 Infisical 保险库中的密钥,包含登录步骤和清晰的错误处理。