Skip to content

Refactor GitHub Actions to support project-centric CI/CD pipelines #304

@claytoncollie

Description

@claytoncollie

Is your enhancement related to a problem? Please describe.

This issue aims to make GitHub Actions more project-centric so teams can easily implement a multi-step process to lint, test, build, and deploy code. The bullet points below highlight features we already have but are used independently. Adopting re-usable workflows and providing some scaffolding up to the deployment job would make it easier for projects to establish a robust pipeline. Since this scaffold is hosting provide agnostic, I suggest we leave that part blank but still provide the files and comments for engineers to drop in their own deployment job.

Reusable Workflow Architecture

  • Our workflows use workflow_call for maximum reusability:
  • Single source of truth - Update once, apply everywhere
  • Easy adoption - Client projects can use workflows with minimal setup
  • Consistent standards - Same quality checks across all projects

Comprehensive Security Scanning

  • TruffleHog Secret Scanning - Prevents API keys and passwords from being committed
  • Virus Scanning - Uses 10up's WP Scanner to detect malicious code
  • Dependency Scanning - Composer and npm security audits

Multi-Language Code Quality

  • PHP: PHPCS (coding standards) + PHPStan (static analysis)
  • JavaScript: ESLint with modern standards
  • CSS: Stylelint for consistent styling

Smart Deployment Pipeline

  • Environment-specific deployments (develop → staging → production)
  • Artifact-based deployments - Build once, deploy multiple times
  • Hosing provider drop-in - Seamless hosting provider integration

Performance Optimizations

  • Intelligent caching - Composer and npm dependencies cached between runs
  • Parallel execution - Multiple jobs run simultaneously
  • Conditional workflows - Only run necessary checks
  • Optimized builds - Production-ready asset compilation

Designs

coding-standards.yml (Orchestrator)
├── stylelint.yml (CSS linting)
├── eslint.yml (JavaScript linting)  
├── phpcs.yml (PHP coding standards)
├── phpstan.yml (PHP static analysis)

code-quality.yml (Orchestrator)
├── virus-scan.yml (Security scanning)
├── truffle-hog.yml (Secret detection)

deployment.yml (Reusable deployment)
├── [All code quality workflows]
├── [All coding standards workflows]
├── Build process (Node + PHP)
└── Deployment

Environment-specific workflows:
├── develop.yml (Auto-deploy from develop branch)
├── staging.yml (Auto-deploy from staging branch)
└── production.yml (Auto-deploy from main branch)

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions