Cicd Pipeline Setup

aj-geddes/useful-ai-prompts/skills/cicd-pipeline-setup

作者 aj-geddes3f5182cfd739无许可证355 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7个月前更新

Design and implement CI/CD pipelines with GitHub Actions, GitLab CI, Jenkins, or CircleCI. Use for automated testing, building, and deployment workflows.

包含脚本DevOps & Cloud
AI 生成的概览

设计并实现适用于 GitHub Actions、GitLab CI、Jenkins 或 CircleCI 的 CI/CD 流水线。

功能
该技能帮助构建自动化持续集成与部署流水线,用于测试代码、构建产物、运行安全检查并部署到多个环境。它提供 GitHub Actions、GitLab CI、Jenkins 和 CI/CD 脚本的参考指南,以及一个流水线模板和一个验证脚本。它产出用于自动化测试、构建和部署的流水线配置与工作流定义。
适用场景
适用于设置自动化代码测试与质量检查、容器化应用构建、多环境部署、发布管理,或自动化安全与性能测试。它面向希望减少构建和部署流程中人工干预的团队。
运行要求
附带可执行脚本,包括 scripts/validate-pipeline.sh,以及一个流水线模板。它面向 GitHub Actions、GitLab CI、Jenkins 或 CircleCI 等 CI/CD 平台,部署时需要访问相应代码仓库和平台凭据。

CI/CD Pipeline Setup

Table of Contents

Overview

Build automated continuous integration and deployment pipelines that test code, build artifacts, run security checks, and deploy to multiple environments with minimal manual intervention.

When to Use

  • Automated code testing and quality checks
  • Containerized application builds
  • Multi-environment deployments
  • Release management and versioning
  • Automated security scanning
  • Performance testing integration
  • Artifact management and registry

Quick Start

Minimal working example:

yaml
# .github/workflows/deploy.ymlname: Build and Deploy
on:  push:    branches:      - main      - develop  pull_request:    branches:      - main  workflow_dispatch:
env:  REGISTRY: ghcr.io  IMAGE_NAME: ${{ github.repository }}
jobs:  test:    runs-on: ubuntu-latest    strategy:      matrix:        node-version: [18.x, 20.x]
    steps:// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
GitHub Actions Workflow [blocked]GitHub Actions Workflow
GitLab CI Pipeline [blocked]GitLab CI Pipeline
Jenkins Pipeline [blocked]Jenkins Pipeline
CI/CD Script [blocked]CI/CD Script

Best Practices

✅ DO

  • Fail fast with early validation
  • Run tests in parallel when possible
  • Use caching for dependencies
  • Implement proper secret management
  • Gate production deployments with approval
  • Monitor and alert on pipeline failures
  • Use consistent environment configuration
  • Implement infrastructure as code

❌ DON'T

  • Store credentials in pipeline configuration
  • Deploy without automated tests
  • Skip security scanning
  • Allow long-running pipelines
  • Mix staging and production pipelines
  • Ignore test failures
  • Deploy directly to main branch
  • Skip health checks after deployment

来源与署名

来源:aj-geddes/useful-ai-prompts位于skills/cicd-pipeline-setup提交3f5182c

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架