CI/CD模式参考

Common Stages

lintCode style and static analysis
testUnit + integration tests
buildCompile/bundle artifacts
security-scanSAST, SCA, container scan
deploy-stagingDeploy to staging environment
integration-testE2E tests against staging
deploy-prodDeploy to production (with approval)

Best Practices

fail-fast: trueStop pipeline on first failure
cache: dependenciesCache node_modules, .cargo, etc.
artifacts: reportsStore test/coverage reports
environments: protection rulesRequire approval for production
secrets: vault/OIDCNever hardcode secrets in pipeline