Prerequisites
- A GitHub repository with an development environment that has:
- One protection rule (e.g., required reviewers or wait timer)
- One secret
- Two environment-level variables
- A working Kubernetes cluster for the
developmentnamespace - A Docker build job named
dockerin your workflow
Environment-level variables override repository-level variables. In our example, the repository variable
REPLICAS is set to 2, while in the development environment it’s set to 1.

Verify Current Kubernetes Deployment
Before modifying the workflow, let’s confirm the existing deployment in thedevelopment namespace:
2/2). Now we’ll update the dev-deploy job in .github/workflows/solar-system.yml.
Adding the environment Block
Within a GitHub Actions job:
env:defines environment variables for all steps.environment:applies GitHub environment protection rules and can display a URL in the Actions UI.
Step 1: Basic environment Definition
Replace or augment the env: block with:
Step 2: Populate the url: Field
Use the output of your set-ingress-host-address step so that Actions shows a direct link to the deployed service:
Step 3: Full Workflow Snippet
Below is the relevant section from.github/workflows/solar-system.yml after adding environment:
Observing the Protection Rule in Action
When you push these changes, the dev-deploy job will pause at theenvironment step, waiting out the protection rule’s timer:


Only HTTP/S URLs are supported in the
environment.url field.Tracking Deployments Across Environments (Public Beta)
GitHub’s public beta for deployment tracking shows a history of every deployment per environment under Actions → Deployments. You can review commit details, branch names, timestamps, and durations in one interface.
- Inspect past deployments
- Compare changes
- Sign off on releases
Quick Reference Table
| Field | Description |
|---|---|
| name | The GitHub environment name (e.g., development, staging) |
| url | The HTTP/S link displayed in the Actions UI for quick access |
| protection | Rules such as required reviewers, wait timers, or secrets usage |
Scope and Precedence of Variables
| Scope | Precedence | Example REPLICAS Value |
|---|---|---|
| Environment | High | 1 |
| Repository | Low | 2 |