This directory contains the comprehensive CI/CD pipeline configuration for Universal AI Tools. The pipeline ensures code quality, security, and reliable deployments through automated workflows.
.github/
├── workflows/ # GitHub Actions workflows
│ ├── ci.yml # Main CI pipeline
│ ├── deploy-production.yml # Production deployment
│ ├── deploy-staging.yml # Staging deployment
│ ├── security-scan.yml # Security scanning
│ ├── performance-test.yml # Performance testing
│ ├── docker-build.yml # Docker build & security
│ ├── branch-protection.yml # Code quality gates
│ └── repository-sync.yml # Repository configuration
├── ISSUE_TEMPLATE/ # Issue templates
│ ├── bug_report.yml # Bug report template
│ ├── feature_request.yml # Feature request template
│ └── security_report.yml # Security report template
├── pull_request_template.md # PR template
├── dependabot.yml # Dependency management
└── README.md # This file
Triggers: Push to main/master/develop, Pull requests
Purpose: Comprehensive testing and validation
Jobs:
- Code Quality & Linting: ESLint, Prettier, TypeScript checks
- Security Scanning: Vulnerability detection, secret scanning, CodeQL
- Database Migration Testing: PostgreSQL migration validation
- Testing: Unit, integration, and frontend tests
- Build Validation: Development and production builds
- Performance Testing: Basic performance checks (on labeled PRs)
- Documentation Generation: Auto-generated API docs
Key Features:
- Parallel execution for faster feedback
- Comprehensive test coverage reporting
- Automatic documentation deployment
- Performance baseline tracking
Triggers: Git tags, Manual dispatch
Purpose: Safe production deployments with rollback capability
Jobs:
- Pre-deployment Validation: Production readiness checks
- Build & Package: Production-optimized builds
- Docker Build & Push: Multi-platform container images
- Database Migration: Safe schema updates
- Deployment: Blue-green deployment strategy
- Post-deployment Monitoring: Health checks and alerts
- Rollback: Emergency rollback on failure
Key Features:
- Multi-stage deployment with gates
- Automated rollback on failure
- Performance monitoring
- Release notes generation
Triggers: Push to develop/staging, PR labels, Manual dispatch
Purpose: Fast iteration and testing environment
Jobs:
- Quick Validation: Fast quality checks
- Build: Development-optimized builds
- Deploy: Staging environment deployment
- Validation: Smoke tests and health checks
- Notification: Team notifications
Key Features:
- Fast deployment for quick feedback
- Automatic cleanup of old deployments
- PR integration for preview deployments
Triggers: Daily schedule, Push to main, Pull requests
Purpose: Continuous security monitoring
Jobs:
- Dependency Scan: npm audit, Snyk, vulnerability detection
- Secret Scan: TruffleHog, GitLeaks, credential detection
- Code Security: Static analysis, security rules
- Infrastructure Scan: Docker security, configuration analysis
- License Compliance: License compatibility checking
- Security Report: Comprehensive security assessment
Key Features:
- Multi-tool security scanning
- SARIF integration with GitHub Security tab
- Automated security issue creation
- License compliance monitoring
Triggers: Weekly schedule, Performance-labeled PRs
Purpose: Performance regression detection
Jobs:
- Quick Tests: Basic response time and memory checks
- Load Testing: Artillery-based load testing
- Memory Profiling: Memory leak detection
- Performance Report: Comprehensive performance analysis
Key Features:
- Configurable test duration and load
- Memory leak detection
- Performance threshold enforcement
- Historical performance tracking
Triggers: Push to main/develop, Tags, Pull requests
Purpose: Secure container builds
Jobs:
- Build Preparation: Application build and optimization
- Dockerfile Linting: Hadolint security checks
- Docker Build: Multi-platform container builds
- Security Scanning: Trivy, Grype vulnerability scanning
- Compliance Testing: Container security validation
Key Features:
- Multi-stage Docker builds
- Security-hardened containers
- Vulnerability scanning with SARIF output
- SBOM (Software Bill of Materials) generation
Triggers: Pull requests to protected branches
Purpose: Enforce code quality standards
Jobs:
- Code Quality Gate: Linting, formatting, type checking
- Security Quality Gate: Security checks, secret detection
- Test Quality Gate: Test execution and coverage
- Build Quality Gate: Build validation and size checking
- Change Impact Analysis: Risk assessment
- Final Quality Gate: Overall validation
Key Features:
- Multiple quality gates
- Change impact analysis
- Coverage threshold enforcement
- Breaking change detection
Triggers: Push to main, Manual dispatch
Purpose: Maintain repository configuration
Jobs:
- Sync Labels: Standardized issue/PR labels
- Branch Protection Suggestions: Security recommendations
- Security Configuration: Security best practices
SUPABASE_ACCESS_TOKEN # Supabase CLI access
SUPABASE_PROJECT_ID # Production project ID
SUPABASE_URL # Production Supabase URL
SUPABASE_SERVICE_KEY # Production service key
SUPABASE_ANON_KEY # Production anonymous key
DEPLOY_HOST # Production server host
DEPLOY_USER # Deployment user
DEPLOY_KEY # SSH deployment key
PRODUCTION_URL # Production URL for health checks
STAGING_SUPABASE_URL # Staging Supabase URL
STAGING_SUPABASE_SERVICE_KEY # Staging service key
STAGING_PROJECT_ID # Staging project ID
STAGING_HOST # Staging server host
STAGING_USER # Staging deployment user
STAGING_KEY # Staging SSH key
STAGING_URL # Staging URL
SNYK_TOKEN # Snyk security scanning
CODECOV_TOKEN # Code coverage reporting
GRAFANA_USER # Monitoring dashboard
GRAFANA_PASSWORD # Monitoring password
The pipeline uses environment-specific configurations:
- NODE_VERSION:
20
(consistent Node.js version) - PYTHON_VERSION:
3.12
(for DSPy components) - PERFORMANCE_THRESHOLDS: Response time, memory, CPU limits
- MINIMUM_COVERAGE:
80%
(test coverage requirement)
- ✅ ESLint rules passing
- ✅ Prettier formatting
- ✅ TypeScript compilation
- ✅ No TODO/FIXME accumulation
- ✅ No critical vulnerabilities
- ✅ No hardcoded secrets
- ✅ Dependency security audit
- ✅ SAST analysis passing
- ✅ All unit tests passing
- ✅ Integration tests passing
- ✅ 80%+ test coverage
- ✅ Frontend tests passing
- ✅ Production build successful
- ✅ Application startup test
- ✅ Build size within limits
- ✅ No build warnings/errors
-
Branch Naming:
feature/description bugfix/issue-description hotfix/critical-fix
-
Commit Messages:
type(scope): description Examples: feat(api): add user authentication endpoint fix(ui): resolve navigation menu overflow docs(readme): update installation instructions
-
PR Labels:
- Use
performance
label for performance-related changes - Use
security
label for security-related changes - Use
deploy-staging
to trigger staging deployment
- Use
- Required Checks: All quality gates must pass
- Security Review: Required for security-labeled PRs
- Performance Review: Required for performance-labeled PRs
- Breaking Changes: Must be documented and approved
- Staging First: Always deploy to staging before production
- Health Checks: Verify application health post-deployment
- Rollback Plan: Have a rollback strategy ready
- Monitoring: Monitor metrics post-deployment
- CI/CD pipeline failures
- Security vulnerabilities
- Performance regressions
- Deployment failures
- Check logs: Review workflow run logs
- Dependency issues: Clear cache, update dependencies
- Test failures: Run tests locally first
- Build failures: Verify build works locally
- Environment variables: Verify all secrets are set
- Database migrations: Check migration status
- Health checks: Verify application starts correctly
- Rollback: Use emergency rollback if needed
- False positives: Review and whitelist if necessary
- Dependency vulnerabilities: Update dependencies
- Secret detection: Remove or move to environment variables
- Documentation: Check this README and workflow comments
- Issues: Create an issue with logs and reproduction steps
- Team: Contact the development team for urgent issues
- Test coverage percentage
- Build success rate
- Security vulnerability count
- Code quality score
- Build time
- Test execution time
- Deployment time
- Application startup time
- Vulnerability resolution time
- Security scan success rate
- Dependency update frequency
This CI/CD pipeline is continuously improved based on:
- Developer feedback
- Industry best practices
- Security requirements
- Performance needs
Submit suggestions and improvements through issues or pull requests!
Last Updated: 2025-01-20 Pipeline Version: 1.0.0 Maintainer: Universal AI Tools Team