Custom CI/CD

GitHub Actions: Basic Deployment

The simplest workflow deploys your API to Zuplo on every push to main.

YAML.github/workflows/deploy.yaml
name: Deploy to Zuplo on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 24 - name: Install dependencies run: npm install - name: Deploy to Zuplo run: npx zuplo deploy --api-key "$ZUPLO_API_KEY" --environment "${{ github.ref_name }}" env: ZUPLO_API_KEY: ${{ secrets.ZUPLO_API_KEY }}

This workflow:

  1. Triggers on pushes to the main branch
  2. Checks out your code
  3. Installs dependencies (including the Zuplo CLI)
  4. Deploys to Zuplo using the branch name as the environment name

Since this deploys from main, it updates your production environment.

Passing --environment is technically optional here — without it, the CLI infers the environment name from the checked-out git ref — but inference can pick the wrong name in CI (detached HEAD checkouts, commits that exist on more than one branch, or pull_request merge refs). Passing the branch name explicitly makes every workflow deploy a predictable environment. See the deploy command reference for details.

Next Steps

Last modified on