CI/CD·8 min read·

Deploy Stages: Approval Gates and Environments

Design deployment stages with environments, required checks, and manual approval gates between you and production.

NB

Netbay Developer Relations

Netbay Engineering

On this page

The deploy portion of a pipeline is where engineering meets judgment. It is not enough that tests passed in CI — you want control over when code reaches users, who says it can, and how you can undo it. This post covers modeling deployment as stages with environments, the approval gates that sit between them, and the operational habits that make deploys safe.

Environments as Boundaries

CI platforms let you define environments — staging, production, and any custom one — each with its own rules. An environment is more than a label: it binds particular secrets, marks the job's deployment status, and can require approvals and checks before it runs.

yaml
  deploy-staging:
    runs-on: ubuntu-latest
    environment: staging
    needs: [test, build]
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: web-dist
      - run: ./deploy.sh staging

  deploy-production:
    runs-on: ubuntu-latest
    environment: production
    needs: deploy-staging
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: web-dist
      - run: ./deploy.sh production

Notice the sequencing: production needs staging. That alone guarantees the artifact has been through staging before, but it does not yet add a human checkpoint.

Approval Gates

A manual approval gate is the mechanism that turns "delivery" into a deliberate, reviewed action. You configure the production environment so that a protected reviewer must approve before the deploy job runs. The job pauses; a reviewer inspects the diff and test results; then it proceeds or is rejected.

Gates are powerful because they are explicit. The pipeline itself refuses to deploy without a human who has the authority to say yes. That is a very different posture from relying on everyone to remember to be careful.

What Belongs Inside the Gate

Before you approve a production deploy, confirm these are true:

  • CI is green on the exact commit, not ten commits ago.
  • The artifact is the one produced by that run, with the same bytes staging tested.
  • Secrets are scoped to the production environment only.
  • A rollback plan exists for the specific change.

A good gate is not a rubber stamp. It exists to enforce these checks as a checklist, not to add friction for its own sake.

CI green tests + build staging deploy automatic approval gate human review rollback ready deploy + undo monitor post-deploy health gate = decision point

Rollback Is Part of Deploy

A deploy without a rollback is a gamble, not an engineering move. Decide before you deploy how you can undo it. The cleanest rollback is to redeploy the previous verified artifact — you kept it, so the previous bytes are still trustworthy and reachable. That is a real advantage of storing immutable artifacts: rollback becomes "point at an older artifact" rather than "revert code and pray the rebuild matches."

bash
# rollback re-runs the deploy pointing at the previous artifact
./deploy.sh production --artifact previous-verified

Avoid reverting source and rebuilding when you can simply redeploy the known-good artifact. Reverting code changes behavior in ways tests did not verify; an old artifact is exactly what was tested.

Progressive Delivery

Approval gates work well with progressive rollout: deploy a small percentage, watch metrics, then widen. This turns a single binary deploy into a series of smaller decisions, each backed by data. Feature flags complement this — ship the code behind a flag, turn it on gradually, and roll back instantly by flipping the flag off without a redeploy. Gates, flags, and canary percentages combine into a delivery system where every step is deliberate.

Environments Need Operations Behind Them

The best-decorated environment is useless if the staging box is not maintained. Keep staging realistic — same artifact, same configuration shape, matching dependencies. If staging is a stripped-down afterthought, the approval gate gives false confidence. An environment is only as trustworthy as the operations that keep it aligned with production.

Takeaway

Model deployment as environments that run the immutable artifact, use approval gates to put a deliberate human checkpoint before production, and always pair a deploy with a rollback plan. Gates convert deployment from an event into a reviewed, reversible decision.

Netbay lets you maintain separate staging and production VPS easily, each isolated and reachable, so your environment model maps to real machines — manage them at netbayhosts.in.

Keep reading

Follow along on a real VPS

Deploy Linux in under 60 seconds

These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.

Deploy an instance