Skip to main content
Skip to main content

CI/CD on Zerops

Zerops supports GitHub/GitLab webhook triggers (new tag or push to branch) and GitHub Actions / GitLab CI via zcli push with an access token.

GitHub Integration (Webhook)

Setup (GUI)

  1. Service detail → Build, Deploy, Run Pipeline Settings
  2. Connect with GitHub repository
  3. Select repo + authorize (requires full access for webhooks)
  4. Choose trigger: New tag (optional regex filter) or Push to branch

GitHub Actions

name: Deploy
on: push
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: zeropsio/actions@v1.0.2
with:
access-token: ${{ secrets.ZEROPS_TOKEN }}
service-id: ${{ secrets.ZEROPS_SERVICE_ID }}
  • access-token: From Settings → Access Token Management
  • service-id: From service URL or three-dot menu → Copy Service ID
  • The compact zeropsio/actions wrapper exposes only access-token/service-id — it cannot pass --setup. For a multi-setup zerops.yaml, install zcli and run zcli push --service-id "${{ secrets.ZEROPS_SERVICE_ID }}" --setup <name> instead

GitLab Integration (Webhook)

Setup (GUI)

  1. Service detail → Build, Deploy, Run Pipeline Settings
  2. Connect with GitLab repository
  3. Authorize (requires full access for webhooks)
  4. Choose trigger: New tag (optional regex) or Push to branch

Skip Pipeline

Include [ci skip] or [skip ci] (with the square brackets) in the commit message (case-insensitive).

Disconnect

Service detail → Build, Deploy, Run → Stop automatic build trigger.

Gotchas

  1. External/CI deploys leave ZCP unaware: a webhook or CI zcli push does not record the deploy in ZCP local state — the service stays at deployState=never-deployed. Bridge it with zerops_workflow action="record-deploy" targetService="<hostname>" when you return to the ZCP develop flow

GitLab CI

deploy:
stage: deploy
image: ubuntu:latest
script:
- apt-get update && apt-get install -y curl
- curl -L https://zerops.io/zcli/install.sh | sh
- zcli login $ZEROPS_TOKEN
- zcli push --project-id $ZEROPS_PROJECT_ID --service-id $ZEROPS_SERVICE_ID
only:
- main

Generic CI (Any System)

Any CI system with shell access can deploy via zcli push:

  1. Install zcli: curl -L https://zerops.io/zcli/install.sh | sh
  2. Authenticate: zcli login <access-token>
  3. Deploy: zcli push --project-id <id> --service-id <id>

zcli push key flags

FlagDescription
--project-idTarget project ID
--service-idTarget service ID
--setupzerops.yml setup name (if different from service hostname)
--version-nameCustom version label (e.g. git tag)
--workspace-stateall (default), clean (git clean), staged (staged only)
--no-gitDeploy without git context
--deploy-git-folderInclude .git/ directory in deploy