Interview Prep/CI/CD/GitHub Actions

A single monorepo workflow is 600 lines. How do you organize it?

IntermediateScenarioGitHub Actions
Answer

Situation read → Workflow sprawl.

What I'd do →

  1. Split per domain (api.yml, web.yml) with path filters.
  2. Extract reusable workflows (workflow_call) for build/deploy, and composite actions for setup.
  3. Keep matrix and conditionals readable; YAML anchors are now supported in workflow files, but use them sparingly because they hide the effective job definition.

Why → Reusable workflows and composite actions give versioned, testable reuse, while anchors only deduplicate text inside one file.

Interview tip → Reuse across files needs reusable workflows or composite actions, not anchors.

All CI/CD questions

More on GitHub Actions