Guides

Deploy from CI

Deploy on every push with a scoped API key and GitHub Actions.

Deploy automatically from CI using a deploy-scoped API key — safe to store as a secret because it can't manage keys, billing, or delete your account.

1. Create a deploy key

In the dashboard, go to API Keys, choose scope Deploy, and copy the sm_live_... token. Add it to your repo as a secret named SERVERME_API_KEY.

2. GitHub Actions workflow

name: Deployon:  push:    branches: [main]jobs:  deploy:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@v4      - name: Install Deployzy CLI        run: npm install -g deployzy      - name: Deploy        env:          SERVERME_API_KEY: ${{ secrets.SERVERME_API_KEY }}        run: |          deployzy authtoken "$SERVERME_API_KEY"          deployzy deploy --repo ${{ github.repository }} --name api --no-follow

Or with curl (no CLI)

curl -s -X POST https://api.deployzy.com/api/v1/projects/$PROJECT_ID/deploy \  -H "X-API-Key: $SERVERME_API_KEY"

Or with the SDK

import { Deployzy } from "deployzy-sdk";const sme = new Deployzy({ authtoken: process.env.SERVERME_API_KEY });await sme.projects.deploy(process.env.PROJECT_ID);const final = await sme.projects.waitForDeploy(process.env.PROJECT_ID);if (final.status !== "running") process.exit(1);

See Projects & Deploys for the full API.

Was this page helpful?