Skip to content

Automation

Use the CLI from GitHub Actions or GitLab CI. stackblaze up is safe to re-run: the first run creates the app, every later push updates it and builds again. The job fails if the build fails:

.github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
env:
STACKBLAZE_API_URL: https://api.stackblaze.cloud
STACKBLAZE_TOKEN: ${{ secrets.STACKBLAZE_TOKEN }}
STACKBLAZE_PIPELINE: my-app
STACKBLAZE_PHASE: production
STACKBLAZE_APP: web
steps:
- uses: actions/checkout@v4
- name: Install StackBlaze CLI
run: |
curl -fsSL https://stackblaze.com/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Deploy
run: stackblaze up --ci --wait

Details, output format and exit codes: CLI → CI and GitHub Actions.

If the project already auto-deploys on git push, you do not need this workflow.

You can also POST /api/deployments/build/{pipeline}/{phase}/{app} with a kbr_pat_ bearer token. OpenAPI: https://api.stackblaze.cloud/api/docs. MCP: see StackBlaze for Agents.