ClaudeChatGPTCopilotDeveloper & CodeIntermediate

CI/CD Pipeline (GitHub Actions)

Set up a complete CI/CD pipeline with GitHub Actions including build, test, lint, deploy, and environment management.

Updated June 2026

cicd-pipeline-github-actions.txt
Copy & Download at the bottom ↓
You are a DevOps engineer who configures robust and simple CI/CD pipelines. Your principles: (1) fast pipeline — if it takes more than 10 min, the dev will ignore it, (2) clear feedback — when it fails, the message should say exactly what went wrong, (3) separate environments — staging before production, always, (4) easy rollback — it should be possible to roll back in 1 minute.

Create the CI/CD pipeline for:

**Project:** [type — web app, API, mobile, monorepo]
**Stack:** [e.g.: Next.js, Node.js, Python/Django, Go]
**Repository:** [GitHub — monorepo or single]
**Tests:** [Jest, pytest, Go test — which ones exist]
**Linting:** [ESLint, Prettier, Black — which ones are used]
**Build:** [how it builds — npm run build, docker build, etc.]
**Deploy:** [where it deploys — Vercel, AWS, Railway, Docker, Kubernetes]
**Environments:** [staging, production, preview]
**Branches:** [main = prod? develop = staging? feature branches?]
**Database:** [does it need migration on deploy?]
**Secrets:** [required environment variables]

Deliver:

**1. CI/CD Strategy** - Diagram of the complete flow
**2. CI Workflow (Pull Request)** - Complete YAML for .github/workflows/ci.yml
**3. CD Workflow (Deploy)** - YAML for staging/prod deploy
**4. Preview Workflow** - Automatic deploy for each PR
**5. Secrets configuration** - List of required secrets
**6. Branch protection rules** - Recommended configurations
**7. Post-deploy monitoring** - Health check and alerts
**8. Optimizations** - Cache, parallelization, skip CI

When to Use

When setting up CI/CD for the first time in a project

To automate tests that the team forgets to run

When standardizing the deploy process

When manual deploys cause problems

How to Use This Prompt

1

Copy the prompt below into Claude or ChatGPT

2

Describe the project, stack, and deploy process

3

Receive the complete GitHub Actions workflow

4

Configure it in the repository (.github/workflows/)

Example Input

Project: Node.js API (Express + TypeScript)
Tests: Jest (unit + integration)
Linting: ESLint + Prettier
Deploy: Docker → AWS ECS
Branches: main = prod, develop = staging
DB: PostgreSQL (needs migration with Prisma)

Expected Output

name: CI
on:
  pull_request:
    branches: [main, develop]

jobs:
  lint:
    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 format:check

  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:15
        env:
          POSTGRES_DB: test
          POSTGRES_PASSWORD: test
        ports: ['5432:5432']
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: 'npm'
      - run: npm ci
      - run: npx prisma migrate deploy
        env:
          DATABASE_URL: postgresql://postgres:test@localhost:5432/test
      - run: npm test -- --coverage

Ready to use this prompt?