Deploy only when you explicitly tag a release. This gives you complete control
over what reaches production—no accidental deployments from work in progress.
.github/workflows/tag-deploy.yaml
name: Tag-Based Deployon: push: tags: - "v*"jobs: deploy: runs-on: ubuntu-latest env: ZUPLO_API_KEY: ${{ secrets.ZUPLO_API_KEY }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npm install - name: Deploy with tag as environment name run: | # Extract tag name (e.g., v1.2.3 -> v1.2.3) TAG_NAME="${GITHUB_REF#refs/tags/}" npx zuplo deploy \ --api-key "$ZUPLO_API_KEY" \ --environment "$TAG_NAME"
This workflow:
Triggers only when you push a tag matching v* (like v1.0.0, v2.1.3)
Creates an environment named after the tag
Deploys your API to that environment
Creating a Release
Code
# Tag the current commitgit tag v1.0.0# Push the tag to trigger deploymentgit push origin v1.0.0
Deploying to Production
If you want tags to update your production environment instead of creating new
environments:
Code
- name: Deploy to production run: | npx zuplo deploy \ --api-key "$ZUPLO_API_KEY" \ --environment main # or your production environment name
With GitHub Releases
Combine with GitHub Releases for a complete release workflow: