Production deploy needs manual trigger and the environment must show up in GitLab's Environments page.

BeginnerScenarioGitLab CI
Answer

Situation read → Manual gated deploy with environment tracking.

What I'd do →

deploy_prod:
  stage: deploy
  script: ./deploy.sh prod
  environment:
    name: production
    url: https://app.example.com
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
      when: manual

Protect the production environment so only certain roles can deploy.

Why → Protected environments enforce who may run the manual job.

Interview tip → Mention allow_failure: false on manual jobs to block the pipeline until it is run.

All CI/CD questions Roadmap: GitLab CI/CD

More on GitLab CI