Skip to content
ci-cd-pipelines logo

CI/CD Pipelines

ci-cd-pipelines

Auto-activates when user mentions CI/CD, GitHub Actions, pipeline, continuous integration, deployment automation, or workflow files. Creates automated testing and deployment pipelines.

SKILL.md

Full skill instructions

CI/​CD Pipelines

Creates automated CI/​CD pipelines for testing, building, and deploying applications.

When This Activates

  • User says: "setup CI/​CD", "GitHub Actions", "create pipeline", "automate deployment"
  • User mentions: "continuous integration", "automated tests", "deploy automation"
  • Files: .github/​workflows/​*.yml, .gitlab-ci.yml, circle.yml
  • Questions about testing/​deployment automation

GitHub Actions Workflows

Complete CI/​CD Pipeline

# .github/​workflows/​ci-cd.yml
name: CI/​CD Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

env:
  NODE_VERSION: '18'
  REGISTRY: ghcr.io
  IMAGE_NAME: ${{ github.repository }}

jobs:
  lint:
    name: Lint Code
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      
      - name: Setup Node.js
        uses: actions/​setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'npm'
      
      - name: Install dependencies
        run: npm ci
      
      - name: Run ESLint
        run: npm run lint
      
      - name: Run Prettier
        run: npm run format:check

  test:
    name: Run Tests
    runs-on: ubuntu-latest
    
    services:
      postgres:
        image: postgres:15
        env:
          POSTGRES_PASSWORD: postgres
          POSTGRES_DB: test_db
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432
    
    steps:
      - uses: actions/​checkout@v4
      
      - name: Setup Node.js
        uses: actions/​setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'npm'
      
      - name: Install dependencies
        run: npm ci
      
      - name: Run unit tests
        run: npm run test:unit
        env:
          DATABASE_URL: postgresql://postgres:postgres@localhost:5432/​test_db
      
      - name: Run integration tests
        run: npm run test:integration
        env:
          DATABASE_URL: postgresql://postgres:postgres@localhost:5432/​test_db
      
      - name: Generate coverage report
        run: npm run test:coverage
      
      - name: Upload coverage to Codecov
        uses: codecov/​codecov-action@v3
        with:
          files: ./​coverage/​coverage-final.json
          fail_ci_if_error: true

  build:
    name: Build Application
    runs-on: ubuntu-latest
    needs: [lint, test]
    
    steps:
      - uses: actions/​checkout@v4
      
      - name: Setup Node.js
        uses: actions/​setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'npm'
      
      - name: Install dependencies
        run: npm ci
      
      - name: Build application
        run: npm run build
      
      - name: Upload build artifacts
        uses: actions/​upload-artifact@v3
        with:
          name: dist
          path: dist/
          retention-days: 7

  docker:
    name: Build Docker Image
    runs-on: ubuntu-latest
    needs: [lint, test]
    if: github.event_name == 'push'
    
    permissions:
      contents: read
      packages: write
    
    steps:
      - uses: actions/​checkout@v4
      
      - name: Set up Docker Buildx
        uses: docker/​setup-buildx-action@v3
      
      - name: Log in to Container Registry
        uses: docker/​login-action@v3
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      
      - name: Extract metadata
        id: meta
        uses: docker/​metadata-action@v5
        with:
          images: ${{ env.REGISTRY }}/​${{ env.IMAGE_NAME }}
          tags: |
            type=ref,event=branch
            type=ref,event=pr
            type=semver,pattern={{version}}
            type=semver,pattern={{major}}.{{minor}}
            type=sha
      
      - name: Build and push Docker image
        uses: docker/​build-push-action@v5
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}
          cache-from: type=gha
          cache-to: type=gha,mode=max

  deploy-staging:
    name: Deploy to Staging
    runs-on: ubuntu-latest
    needs: [build, docker]
    if: github.ref == 'refs/​heads/​develop'
    environment:
      name: staging
      url: https://staging.example.com
    
    steps:
      - uses: actions/​checkout@v4
      
      - name: Deploy to Vercel
        uses: amondnet/​vercel-action@v25
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          vercel-args: '--prod'
          working-directory: ./

  deploy-production:
    name: Deploy to Production
    runs-on: ubuntu-latest
    needs: [build, docker]
    if: github.ref == 'refs/​heads/​main'
    environment:
      name: production
      url: https://example.com
    
    steps:
      - uses: actions/​checkout@v4
      
      - name: Deploy to Vercel Production
        uses: amondnet/​vercel-action@v25
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
          vercel-args: '--prod'
      
      - name: Notify Slack
        uses: 8398a7/​action-slack@v3
        with:
          status: ${{ job.status }}
          text: 'Deployment to production completed!'
          webhook_url: ${{ secrets.SLACK_WEBHOOK }}
        if: always()

  security-scan:
    name: Security Scan
    runs-on: ubuntu-latest
    
    steps:
      - uses: actions/​checkout@v4
      
      - name: Run Trivy vulnerability scanner
        uses: aquasecurity/​trivy-action@master
        with:
          scan-type: 'fs'
          scan-ref: '.'
          format: 'sarif'
          output: 'trivy-results.sarif'
      
      - name: Upload Trivy results to GitHub Security
        uses: github/​codeql-action/​upload-sarif@v2
        with:
          sarif_file: 'trivy-results.sarif'

Optimized PR Workflow

# .github/​workflows/​pr-checks.yml
name: PR Checks

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  changes:
    name: Detect Changes
    runs-on: ubuntu-latest
    outputs:
      frontend: ${{ steps.filter.outputs.frontend }}
      backend: ${{ steps.filter.outputs.backend }}
    steps:
      - uses: actions/​checkout@v4
      
      - uses: dorny/​paths-filter@v2
        id: filter
        with:
          filters: |
            frontend:
              - 'src/​frontend/​**'
              - 'package.json'
            backend:
              - 'src/​backend/​**'
              - 'src/​api/​**'

  frontend-tests:
    name: Frontend Tests
    needs: changes
    if: needs.changes.outputs.frontend == 'true'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      - uses: actions/​setup-node@v4
        with:
          node-version: '18'
          cache: 'npm'
      - run: npm ci
      - run: npm run test:frontend

  backend-tests:
    name: Backend Tests
    needs: changes
    if: needs.changes.outputs.backend == 'true'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      - uses: actions/​setup-node@v4
        with:
          node-version: '18'
          cache: 'npm'
      - run: npm ci
      - run: npm run test:backend

Caching Strategies

- name: Cache node modules
  uses: actions/​cache@v3
  with:
    path: ~/​.npm
    key: ${{ runner.os }}-node-${{ hashFiles('**/​package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-node-

- name: Cache build output
  uses: actions/​cache@v3
  with:
    path: |
      dist
      .next/​cache
    key: ${{ runner.os }}-build-${{ github.sha }}
    restore-keys: |
      ${{ runner.os }}-build-

Matrix Testing

test:
  name: Test on ${{ matrix.os }} - Node ${{ matrix.node }}
  runs-on: ${{ matrix.os }}
  
  strategy:
    matrix:
      os: [ubuntu-latest, windows-latest, macos-latest]
      node: ['16', '18', '20']
    fail-fast: false
  
  steps:
    - uses: actions/​checkout@v4
    - uses: actions/​setup-node@v4
      with:
        node-version: ${{ matrix.node }}
    - run: npm ci
    - run: npm test

Secrets Management

- name: Configure AWS credentials
  uses: aws-actions/​configure-aws-credentials@v4
  with:
    aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    aws-region: us-east-1

- name: Use secrets in environment
  run: npm run deploy
  env:
    DATABASE_URL: ${{ secrets.DATABASE_URL }}
    API_KEY: ${{ secrets.API_KEY }}
    STRIPE_SECRET: ${{ secrets.STRIPE_SECRET_KEY }}

Reusable Workflows

# .github/​workflows/​deploy.yml
name: Reusable Deploy Workflow

on:
  workflow_call:
    inputs:
      environment:
        required: true
        type: string
      version:
        required: true
        type: string
    secrets:
      deploy_token:
        required: true

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      - name: Deploy to ${{ inputs.environment }}
        run: ./​deploy.sh ${{ inputs.environment }} ${{ inputs.version }}
        env:
          DEPLOY_TOKEN: ${{ secrets.deploy_token }}

# Usage in another workflow:
# uses: ./​.github/​workflows/​deploy.yml
# with:
#   environment: 'staging'
#   version: '1.0.0'
# secrets:
#   deploy_token: ${{ secrets.DEPLOY_TOKEN }}

Status Badges

![CI/​CD](https://github.com/​user/​repo/​workflows/​CI-CD%20Pipeline/​badge.svg)
![Tests](https://github.com/​user/​repo/​workflows/​Tests/​badge.svg)
[![codecov](https://codecov.io/​gh/​user/​repo/​branch/​main/​graph/​badge.svg)](https://codecov.io/​gh/​user/​repo)

Best Practices

1. Job Dependencies

jobs:
  build:
    runs-on: ubuntu-latest
  
  test:
    needs: build  # Runs after build completes
    runs-on: ubuntu-latest
  
  deploy:
    needs: [build, test]  # Runs after both complete
    runs-on: ubuntu-latest

2. Conditional Execution

- name: Deploy
  if: github.ref == 'refs/​heads/​main' && github.event_name == 'push'
  run: ./​deploy.sh

- name: Comment on PR
  if: failure()
  uses: actions/​github-script@v6
  with:
    script: |
      github.rest.issues.createComment({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.name,
        body: '❌ CI failed! Please check the logs.'
      })

3. Timeout and Retry

- name: Flaky test
  timeout-minutes: 10
  continue-on-error: true
  run: npm test

- name: Deploy with retry
  uses: nick-fields/​retry-action@v2
  with:
    timeout_minutes: 10
    max_attempts: 3
    command: npm run deploy

Pipeline Checklist

  • Runs on every push and PR
  • Linting before tests
  • Unit tests with coverage
  • Integration tests with services
  • Security scanning
  • Docker image building
  • Automated deployment to staging
  • Manual approval for production
  • Notifications on failure
  • Status badges in README
  • Secrets properly managed
  • Caching for faster builds

Generate workflows, present to user, create files with approval.

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View