GitHub Actions CI/CD Pipeline

devops
YAML
testing
minimalist
Remix

Production-grade CI/CD workflow with testing, building, and deployment.

12/8/2025

Prompt

GitHub Actions CI/CD Pipeline

Create a comprehensive GitHub Actions workflow at .github/workflows/ci-cd.yml for a [Framework] project.

Workflow Configuration

1. Triggers

  • Push to main branch
  • Pull request events

2. Environment Matrix

  • Multiple Node.js versions (e.g., 18.x, 20.x)
  • Test across different environments

3. Build & Test Steps

  1. Checkout code - actions/checkout@v4
  2. Setup environment - Install Node.js with version matrix
  3. Install dependencies - With caching for faster builds
  4. Run linter - ESLint, Prettier checks
  5. Run unit tests - With coverage reporting
  6. Run E2E tests - Playwright, Cypress
  7. Build production bundle - Verify successful build

4. Deployment Job

  • Conditional execution (only on main branch push)
  • Deploy to staging/production
  • Use deployment secrets

5. Notifications

  • Send alerts on failure
  • Slack, Discord, or email notifications

6. Security

  • Use GitHub secrets for sensitive data
  • Never expose API keys or credentials

7. Performance Optimizations

  • Parallel job execution
  • Dependency caching
  • Artifact caching between jobs

Requirements

  • Production-ready configuration
  • Following GitHub Actions best practices
  • Optimized for speed and reliability

Tags

github-actions
ci-cd
automation
deployment

Tested Models

gpt-4
claude-3-sonnet

Comments (0)

Sign in to leave a comment

Sign In