GitHub Actions CI/CD Pipeline
devops
YAML
testing
minimalist
Production-grade CI/CD workflow with testing, building, and deployment.
By alex_dev
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
mainbranch - Pull request events
2. Environment Matrix
- Multiple Node.js versions (e.g., 18.x, 20.x)
- Test across different environments
3. Build & Test Steps
- Checkout code -
actions/checkout@v4 - Setup environment - Install Node.js with version matrix
- Install dependencies - With caching for faster builds
- Run linter - ESLint, Prettier checks
- Run unit tests - With coverage reporting
- Run E2E tests - Playwright, Cypress
- Build production bundle - Verify successful build
4. Deployment Job
- Conditional execution (only on
mainbranch 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