dev-deploy job to leverage environment tags. By specifying an environment:
- You can enforce protection rules (e.g., required approvals or wait timers).
- Access environment-scoped secrets and variables.
- Surface the deployment URL directly in the GitHub UI.
Prerequisites: Review Your Environment
First, recall thedevelopment environment configuration. It includes one protection rule, one secret, and two variables. Environment-scoped variables always take precedence over repository-level variables.

Environment-level variables override repository variables. This ensures you can customize settings (like replica counts) for each deployment stage.
replicas: 2) against the environment-level variables (replicas: 1):

| Scope | Definition | Priority |
|---|---|---|
| Repository | Variables and secrets at the repo level | Lower |
| Environment | Variables and secrets scoped to env. | Higher |
Verify Current Deployment
Usekubectl to inspect your deployments and pods in the development namespace:
solar-system deployment uses two replicas (from the repository variable). We want to switch this to the environment variable value (1 replica) by invoking the development environment in our workflow.
Update the Workflow
To enforce environment protections and show the deployment URL in the workflow summary, add anenvironment block under the dev-deploy job:
After this change, the
dev-deploy job will pend if the environment has protection rules (e.g., a wait timer or approval). Administrators must review and approve to proceed.Approving the Pending Deployment
Once the workflow hits thedev-deploy job, you’ll see it pending due to environment protection:


dev-deploy job runs. Upon success, the deployment URL appears in the workflow summary:

View Deployments Across Environments
GitHub’s public beta for deployment tracking offers a centralized overview of deployments across all environments. Access it via Actions > Deployments in your repository:
With environments configured in your GitHub Actions workflow, you can enforce rules, manage scoped secrets and variables, and prominently display deployment URLs for fast verification.