Interview Prep/GitHub Actions/Pipeline Design & Triggers

Product wants a "Deploy to staging" button that lets QA pick a version. Design it.

BeginnerScenarioPipeline Design & Triggers
Answer

Situation read → A manual, parameterized deploy with guardrails.

What I'd do →

  1. workflow_dispatch with typed inputs:
    on:
      workflow_dispatch:
        inputs:
          version: { type: string, required: true, description: "Image tag, for example v1.4.0" }
          environment: { type: environment, required: true }
    
  2. A first job validates the tag exists in ECR (aws ecr describe-images --image-ids imageTag=$VERSION).
  3. Call the reusable deploy workflow with environment: ${{ inputs.environment }}, so environment rules apply (prod still needs approvers).
  4. Write the deployed version to $GITHUB_STEP_SUMMARY.

Why → QA self-serves without kubectl access, and the environment layer keeps prod controlled.

Interview tip → Use type: environment so the dropdown lists real environments and typos are impossible.

All GitHub Actions questions Roadmap: GitHub Actions

More on Pipeline Design & Triggers