IntermediateDevOpsFree prompt

Complete CI/CD Pipeline with GitHub Actions for Next.js Applications

Automated pipeline configuration with tests, build, preview deploys, and production deployment.

Automate the entire software delivery lifecycle with GitHub Actions, from push to production deployment, including tests, code analysis, and preview environments.

At a glance

Access

Free prompt

Open to copy — no account or payment needed.

Prompt objective

Automate the entire software delivery lifecycle with GitHub Actions, from push to production deployment, including tests, code analysis, and preview environments.

Real use case

A fintech startup currently performs manual deployments via SSH with no automated tests. Their last deployment broke production for 3 hours because a developer forgot to run the tests. They need a pipeline that prevents broken code from reaching production.

Customize these fields first

PROJECT NAMEVERSIONVERCEL/AWS/DOCKER + VPSYES/NONUMBERPOSTGRESQL/MYSQLENVIRONMENT

Replace the placeholders with your own context before you run the prompt. That usually improves the first output more than adding more instructions later.

Prompt

Create a complete CI/CD pipeline with GitHub Actions for [PROJECT NAME], a Next.js [VERSION] application deployed on [VERCEL/AWS/DOCKER + VPS].

**Context:**
- Repository: monorepo [YES/NO]
- Branches: main (production), develop (staging), feature/*
- Existing tests: [NUMBER] unit, [NUMBER] E2E
- Database: [POSTGRESQL/MYSQL] — migrations required
- Environment variables: [NUMBER] secrets

**Workflow 1 — Pull Request (CI):**
```yaml
# Trigger: push to any branch except main
```
- Checkout + node_modules cache (pnpm store)
- Type checking: `tsc --noEmit`
- Linting: ESLint + Prettier check
- Unit tests: Jest/Vitest with coverage report
- E2E tests: Playwright with failure screenshots
- Verification build: `next build`
- Automatic preview deployment (unique URL per PR)
- Automatic PR comment with: preview link, coverage %, bundle size diff
- Mandatory status checks for merge

**Workflow 2 — Merge to main (CD):**
```yaml
# Trigger: push to main
```
- All CI checks
- Database migrations (with automatic rollback on failure)
- Optimized production build
- Deploy to [ENVIRONMENT]
- Post-deploy smoke tests (health check + critical endpoints)
- Slack/Discord notification: success or failure
- Automatic semantic versioning tag

**Workflow 3 — Scheduled (Maintenance):**
- Dependabot/Renovate: dependency updates
- Weekly security audit (`pnpm audit`)
- Lighthouse CI: performance monitoring
- Database backup verification

**Advanced Configuration:**
- Matrix strategy for testing on Node 18 and 20
- Concurrency: cancel previous workflows on the same branch
- Docker layer caching (if applicable)
- Secrets management: GitHub Environments (staging, production)
- Recommended branch protection rules

Provide complete, functional YAML files for each workflow.

Open directly in an AI — the text is pre-filled:

How to use this prompt

  1. 1Replace the key placeholders first: PROJECT NAME, VERSION, VERCEL/AWS/DOCKER + VPS, YES/NO.
  2. 2Replace any bracketed placeholders like [this] with your own context.
  3. 3Add extra background information when you want more tailored results.
  4. 4Combine multiple prompts in one conversation when you need a richer output.
  5. 5Save your best-performing prompts so they are easy to reuse later.

Next best step

Open the guide first, then branch only if you still need more.

A guide for technical builders choosing between prompts, coding workflows, and agent-based implementation.

If this prompt is close but not quite right, generate variants next. If the job is recurring, move into the course library after the guide.

Related prompts

View all

Explore other prompt categories

Move sideways into adjacent libraries when the current category is not the full answer.

Every prompt here is free. The course teaches the thinking behind them.

Copy as many prompts as you like. When you want to move from single prompts to a repeatable AI workflow, Learn AI in 30 Days walks through it, one day at a time.

Get the courseSee the 30-day curriculum first

Buy the course once ($15/$20 by length), or go all-access for $10/mo with a verifiable certificate.