Interview Prep/CI/CD/GitHub Actions

Developers can trigger production deploys manually with a chosen version.

BeginnerScenarioGitHub Actions
Answer

Situation read → On-demand deploy with inputs.

What I'd do →

on:
  workflow_dispatch:
    inputs:
      version:
        description: Image tag to deploy
        required: true
      environment:
        type: choice
        options: [staging, production]

Use environment: ${{ inputs.environment }} so approvals apply, and validate the version exists in the registry before deploying.

Why → Typed inputs reduce mistakes, and environments keep approvals enforced.

Interview tip → Never interpolate inputs.* directly into shell; pass through env.

All CI/CD questions

More on GitHub Actions