Skip to content
ci-cd-pipeline logo

CI/CD Pipeline Skill

ci-cd-pipeline

GitHub Actions CI/CD patterns for automated testing, building, and deployment. Covers workflow syntax, secrets management, matrix builds, and deployment strategies.

SKILL.md

Full skill instructions

CI/​CD Pipeline Skill

Build robust CI/​CD pipelines with GitHub Actions for automated testing, building, and deployment.

Core Workflow Structure

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

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

env:
  NODE_VERSION: '20'

jobs:
  # Job 1: Lint and Type Check
  quality:
    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: Lint
        run: npm run lint

      - name: Type check
        run: npm run type-check

  # Job 2: Test
  test:
    runs-on: ubuntu-latest
    needs: quality
    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 tests
        run: npm test -- --coverage

      - name: Upload coverage
        uses: codecov/​codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}

  # Job 3: Build
  build:
    runs-on: ubuntu-latest
    needs: 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
        run: npm run build

      - name: Upload build artifacts
        uses: actions/​upload-artifact@v4
        with:
          name: build
          path: dist/

  # Job 4: Deploy (only on main)
  deploy:
    runs-on: ubuntu-latest
    needs: build
    if: github.ref == 'refs/​heads/​main'
    environment: production
    steps:
      - uses: actions/​checkout@v4

      - name: Download build artifacts
        uses: actions/​download-artifact@v4
        with:
          name: build
          path: dist/

      - 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'

Matrix Builds

Test across multiple versions/​platforms:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        node: [18, 20, 22]
      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

# Using secrets
env:
  DATABASE_URL: ${{ secrets.DATABASE_URL }}
  API_KEY: ${{ secrets.API_KEY }}

# GitHub environment secrets (for staging/​production)
deploy:
  environment: production  # Uses production environment secrets

Caching Strategies

# NPM cache
- uses: actions/​setup-node@v4
  with:
    cache: 'npm'

# Custom cache
- uses: actions/​cache@v4
  with:
    path: |
      ~/​.npm
      node_modules
    key: ${{ runner.os }}-node-${{ hashFiles('**/​package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-node-

Deployment Patterns

Preview Deployments (PRs)

preview:
  if: github.event_name == 'pull_request'
  steps:
    - name: Deploy Preview
      run: vercel --token=${{ secrets.VERCEL_TOKEN }}

    - name: Comment PR
      uses: actions/​github-script@v7
      with:
        script: |
          github.rest.issues.createComment({
            issue_number: context.issue.number,
            owner: context.repo.owner,
            repo: context.repo.repo,
            body: '🚀 Preview: https://preview-url.vercel.app'
          })

Conditional Deploys

deploy:
  if: |
    github.ref == 'refs/​heads/​main' &&
    github.event_name == 'push'

FrankX Standard Pipeline

For FrankX projects, use this template:

name: FrankX CI/​CD

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

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/​checkout@v4
      - uses: actions/​setup-node@v4
        with:
          node-version: '20'
          cache: 'npm'
      - run: npm ci
      - run: npm run lint
      - run: npm run type-check
      - run: npm test

  deploy:
    needs: validate
    if: github.ref == 'refs/​heads/​main'
    runs-on: ubuntu-latest
    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'

Anti-Patterns

❌ Storing secrets in code ❌ No caching (slow builds) ❌ Running all jobs sequentially when they can be parallel ❌ No artifact upload for debugging failed builds ❌ Hardcoded versions instead of matrix

✅ Use environment secrets ✅ Cache dependencies aggressively ✅ Parallelize independent jobs ✅ Upload artifacts for debugging ✅ Use matrix for cross-platform testing

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View