liveBook · Manning

Staging environment

As explained in GitHub Actions in Action: Continuous integration and delivery for DevOps

A staging environment is a pre-production execution environment where a software version is installed and validated before production use.

A staging environment is a pre-production execution environment where a deployable version is installed and validated before it moves to production. It sits after test deployment and before production, providing checks beyond CI workflows: confirm deployment, healthy runtime state, and primary user flows. Automated end-to-end tests can perform those checks, while manual or automated approvals can control progression between stages. section 9.1.1

A practical staging workflow is:

  • Retrieve deployment artifacts prepared during CI and deploy them to an internal staging server. section 9.1.1
  • Wait for readiness or health checks, then run end-to-end tests against the deployed application. section 9.1.1 section 9.3.7
  • Promote only after validation, using an approval process or a deployment strategy that controls how traffic reaches the new version. section 9.1.1 section 9.3.7

In a red–green deployment, staging can be the inactive server or deployment slot. The new version is deployed there while production traffic remains on the active version. After validation, a small percentage of traffic is routed to staging and monitored through application telemetry. Traffic increases in chosen steps when no problems appear; a virtual IP swap then makes the new version production and returns the old server to staging for the next release. section 9.3.7

Validate a deployment slot before routing traffic

A workflow creates an Azure Web App staging slot, deploys the application, and exposes its URL as a job output. A validation job polls the /health/ready endpoint until it reports Healthy, then runs Playwright tests. Subsequent jobs route 10% and then 30% of traffic to the staging slot before swapping the slot into production and clearing routing rules. section 9.3.7

Figure 9.5 Environment setup

The environment setup diagram clarifies the red–green arrangement: one server receives production traffic while the other hosts and validates the staged version. section 9.3.7

How GitHub Actions in Action: Continuous integration and delivery for DevOps covers it

How deep it goes
Details health checks, end-to-end validation, progressive traffic routing, and slot swapping for red–green deployments.
Examples
Uses GloboTicket, an internal staging server, Playwright tests, Azure Web App slots, and staged 10% and 30% traffic routing.
What it assumes
Assumes prepared CI deployment artifacts while introducing staging deployment, validation, and promotion from zero.
What you can do after
Operate/configure a staged deployment that verifies health and user flows before promotion or progressive production routing.
How it connects
Connects CI artifacts, end-to-end testing, deployment approvals, health endpoints, application telemetry, and red–green deployments.

Also explained in

Compare how 4 books explain staging environment →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GitHub Actions in Action: Continuous integration and delivery for DevOps. The section links point to the parts of the book it draws on.