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 →
workflow_dispatchwith typed inputs:on: workflow_dispatch: inputs: version: { type: string, required: true, description: "Image tag, for example v1.4.0" } environment: { type: environment, required: true }- A first job validates the tag exists in ECR (
aws ecr describe-images --image-ids imageTag=$VERSION). - Call the reusable deploy workflow with
environment: ${{ inputs.environment }}, so environment rules apply (prod still needs approvers). - 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.
More on Pipeline Design & Triggers
You join a team whose single 900-line workflow runs everything on every push to every branch. How do you restructure it?IntermediatePushing to a PR branch runs CI twice (once for push, once for pull_request). How do you fix it?BeginnerA nightly security scan should run at 02:00 India time on weekdays and also be runnable on demand. Write it.BeginnerYour team wants preview environments per PR on EKS, destroyed when the PR closes. Design the workflow.AdvancedTwo workflows must run in sequence: CI then a separate deploy workflow owned by another team. How do you link them?IntermediateA merge queue is enabled, but PRs sit in the queue forever. What is your design fix?Intermediate