CI/CD

Deployment Environments and Approval Gates

Use named deployment environments and approval gates to protect sensitive targets while keeping artifacts, permissions, and readiness evidence explicit.

Intermediate14 min read
CI/CD lessonDelivery and reliability foundationsLearn

Use named deployment environments and approval gates to protect sensitive targets while keeping artifacts, permissions, and readiness evidence explicit.

What you will be able to do

  • Distinguish environment target from protection rule in a realistic deployment environments and approval gates case.
  • Interpret the delivery evidence and boundary associated with approval gate.
  • Choose an appropriate action involving environment secret without exceeding the named operational scope.
  • Verify deployment record through an observable service result and reproducible handoff.

01

Frame Deployment Environments and Approval Gates

Use named deployment environments and approval gates to protect sensitive targets while keeping artifacts, permissions, and readiness evidence explicit.

A package may deploy freely to staging, but production requires an authorized reviewer and a healthy change window before the job receives secrets.

Keep the delivery target, declared intent, execution evidence, reliability boundary, and recovery choice separate. Start with observable state and preserve enough context for another operator to reproduce the decision.

02

Environment target

A deployment environment represents a named target with its own policy and history. Within deployment environments and approval gates, this role answers a separate delivery or reliability question and keeps its own evidence.

Reference staging and production explicitly from their deployment jobs. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not infer the target from a runner name or branch alone. The observable result is specific: each deployment record identifies one environment.

03

Protection rule

Environment protection rules can restrict branches, delay work, or require external checks. Within deployment environments and approval gates, this role answers a separate delivery or reliability question and keeps its own evidence.

Require the approved main reference and readiness conditions for production. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not place production policy only in human memory. The observable result is specific: the production job waits until protection rules pass.

04

Approval gate

A manual approval gate is a deliberate policy decision, not a replacement for automated testing. Within deployment environments and approval gates, this role answers a separate delivery or reliability question and keeps its own evidence.

Show the artifact revision and readiness evidence to the reviewer. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not ask a reviewer to approve an unidentified package. The observable result is specific: the approval applies to one recorded deployment attempt.

05

Environment secret

Environment-scoped credentials become available only to jobs authorized for that environment. Within deployment environments and approval gates, this role answers a separate delivery or reliability question and keeps its own evidence.

Keep the production credential inside the protected production job. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not expose production secrets to staging or pull-request jobs. The observable result is specific: only the approved production job can access the credential.

06

Deployment record

Deployment history connects the environment, revision, policy decision, and observed result. Within deployment environments and approval gates, this role answers a separate delivery or reliability question and keeps its own evidence.

Record the reviewer and final service check with the deployment. Apply that action to the named service case before widening the rollout, infrastructure scope, or incident response.

Respect this boundary: do not close the change with an approval event alone. The observable result is specific: the environment history shows authorization and successful verification.

07

Apply Deployment Environments and Approval Gates to One Service Change

Use one bounded delivery decision: A package may deploy freely to staging, but production requires an authorized reviewer and a healthy change window before the job receives secrets.

First, reference staging and production explicitly from their deployment jobs. Then, require the approved main reference and readiness conditions for production. Keep both observations attached to the exact revision, environment, or service window.

Next, show the artifact revision and readiness evidence to the reviewer. After that, keep the production credential inside the protected production job. Close the work only after you record the reviewer and final service check with the deployment.

08

Recap Before Practice and Prove

Environment target: A deployment environment represents a named target with its own policy and history. In this service case, reference staging and production explicitly from their deployment jobs. Preserve the boundary: do not infer the target from a runner name or branch alone.

Protection rule: Environment protection rules can restrict branches, delay work, or require external checks. In this service case, require the approved main reference and readiness conditions for production. Preserve the boundary: do not place production policy only in human memory.

Approval gate: A manual approval gate is a deliberate policy decision, not a replacement for automated testing. In this service case, show the artifact revision and readiness evidence to the reviewer. Preserve the boundary: do not ask a reviewer to approve an unidentified package.

Environment secret — Environment-scoped credentials become available only to jobs authorized for that environment. In this service case, keep the production credential inside the protected production job. Preserve the boundary: do not expose production secrets to staging or pull-request jobs.

Deployment record: Deployment history connects the environment, revision, policy decision, and observed result. In this service case, record the reviewer and final service check with the deployment. Preserve the boundary: do not close the change with an approval event alone.

NEXT STEP

Turn reading into recall

Practice the concepts without a timer, with coaching and retry available after every answer.

Open guided practice