ZuploZuplo
LoginSign Up
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop using the Portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingMCP - Quick start
    Develop Locally
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth
Concepts
Development
Policies
Handlers
API Keys
MCP Server
MCP Gateway
AI Gateway
Developer Portal
Monetization
Deploying & Source Control
    Overview
    GitHub
      SetupTesting Deployments
      Custom CI/CD
        Basic DeploymentDeploy and TestPR Preview EnvironmentsLocal Testing in CITag-Based ReleasesMulti-Stage DeploymentAutomatic Cleanup
    GitLab
    Bitbucket
    Azure DevOps
    CircleCI
    Custom CI/CDMonorepo DeploymentRename/Move Project
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsSecuritySupportTrust & ComplianceChangelog
powered by Zudoku
Custom CI/CD

GitHub Actions: Multi-Stage Deployment

Deploy to staging first, run tests, then promote to production with manual approval. This pattern ensures changes are validated before reaching production.

.github/workflows/multi-stage.yaml
name: Multi-Stage Deployment on: push: branches: - main jobs: deploy-staging: runs-on: ubuntu-latest env: ZUPLO_API_KEY: ${{ secrets.ZUPLO_API_KEY }} outputs: staging-url: ${{ steps.deploy.outputs.url }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npm install - name: Deploy to staging id: deploy shell: bash run: | OUTPUT=$(npx zuplo deploy --api-key "$ZUPLO_API_KEY" --environment staging 2>&1) echo "$OUTPUT" DEPLOYMENT_URL=$(echo "$OUTPUT" | grep -oP 'Deployed to \K(https://[^ ]+)') echo "url=$DEPLOYMENT_URL" >> $GITHUB_OUTPUT test-staging: needs: deploy-staging runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npm install - name: Run tests against staging run: npx zuplo test --endpoint "${{ needs.deploy-staging.outputs.staging-url }}" deploy-production: needs: test-staging runs-on: ubuntu-latest env: ZUPLO_API_KEY: ${{ secrets.ZUPLO_API_KEY }} # Require manual approval environment: production steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npm install - name: Deploy to production run: npx zuplo deploy --api-key "$ZUPLO_API_KEY" --environment production

This workflow:

  1. Deploy to staging — Every push to main deploys to staging
  2. Test staging — Run your full test suite against staging
  3. Wait for approval — The production job waits for manual approval
  4. Deploy to production — After approval, deploy to production

Setting Up Manual Approval

Create a GitHub environment with required reviewers:

  1. Go to Settings > Environments > New environment
  2. Name it production
  3. Check Required reviewers and add approvers
  4. Save the environment

When the workflow reaches the production job, it pauses until an approver clicks Review deployments in the Actions UI.

Adding More Stages

Add additional environments like QA or UAT:

Code
jobs: deploy-staging: # ... test-staging: # ... deploy-qa: needs: test-staging environment: qa # ... test-qa: needs: deploy-qa # ... deploy-production: needs: test-qa environment: production # ...

Next Steps

  • Combine with tag-based releases for version control
  • Add local testing before any deployment
Edit this page
Last modified on December 3, 2025
Tag-Based ReleasesAutomatic Cleanup
On this page
  • Setting Up Manual Approval
  • Adding More Stages
  • Next Steps
YAML
YAML