Docs cipi.yml Web panel API MCP Ecosystem Guides Compare GitHub Telegram channel
  1. Home
  2. Guides
  3. Push to deploy or CI pipeline? Agent vs pipeline deploys for Laravel
Laravel

Push to deploy or CI pipeline? Agent vs pipeline deploys for Laravel

How Cipi's two deploy modes work, side by side, with an honest verdict on when to use the agent's push-to-deploy webhook, when to use a CI pipeline, and how to switch between them.

By Updated 5 min read

Every Cipi deploy runs on your server and does the same thing: pull the branch from Git, build a new release, migrate, switch to it with zero downtime, check it. The only question is who presses the button: your Git provider, every time you push (agent mode), or your CI, when the tests pass (pipeline mode).

In 30 seconds#

Push to deploy (agent)CI pipeline
StartsOn every push to the branchWhen the pipeline's deploy job runs
Tests before going liveNoYes
Setup2 minutes, mostly automatic10 to 30 minutes, once
Secret outside the serverNoneAn API token or an SSH key in CI
Best forSide projects, staging, small teams, fast iterationProduction with real users, teams, regulated apps

Our verdict: push to deploy for staging and personal projects; a pipeline for production once other people depend on the app. Many teams run both: webhook on staging, pipeline on production.

Key ideas, in plain words#

TermMeaning
Deploy branchThe Git branch an app follows, main by default. Only pushes to it deploy
WebhookA URL your Git provider calls after every push. Cipi's is https://your-app/cipi/webhook
Agentcipi/agent, a Composer package that receives the webhook in a Laravel app
PipelineThe steps your CI runs on each push: install, test, then deploy
Deploy lockCipi lets only one deploy per app run at a time

How push to deploy works#

Step 1 of 4git push

You push to the deploy branch.

What makes it good:

  • Nothing to configure. With a Git provider token saved on the server, Cipi creates the webhook and its secret when it creates the app. You add composer require cipi/agent once.
  • No access for anyone. No SSH key, no API token leaves the server. The provider only calls your app over HTTPS.
  • Fast feedback. Push, and about a minute later it's live.

What it doesn't do: it deploys every push to the branch, including a push with a failing test. Cipi's health check can roll back a release that doesn't answer, but it can't know your tests failed.

How a pipeline works#

Step 1 of 4git push

You push. The webhook is off for this app, so nothing deploys yet.

What makes it good:

  • A gate. Only code that passes the tests reaches production.
  • More steps. A backup before the release, an approval, a message to the team, a deploy to several servers in order.
  • Visible. Every deploy is a green or red job in the tool your team already watches.

What it costs: a secret in CI, a workflow file to maintain, and slower releases (your tests run first).

Side by side#

Push to deploy (agent)CI pipeline
Who starts the deployThe Git providerYour CI job
Time from push to liveAbout a minuteTest time + about a minute
Failing testsStill deployedNever deployed
Bad release that crashesRolled back by Cipi if automatic rollback is onRolled back by the pipeline's health check, or by Cipi
Secret outside the serverNoneAPI token (deploy-manage only) or SSH key
NetworkProvider → your app over HTTPSCI → server over SSH (port 22) or the API
Works withGitHub, GitLab, Bitbucket, Gitea, Forgejo, Azure DevOpsAny CI: GitHub Actions, GitLab, Bitbucket, Azure, Jenkins, CircleCI, AWS CodeDeploy…
App requirementcipi/agent (Laravel); built in for Node appsNone
Approvals before productionNoYes, with your CI's environments
Several serversOne webhook per app on each serverOne pipeline deploys them in order
Where you see the resultDeploy notifications, panel, cipi deploy --statusThe CI job, plus the same notifications
Audit ledger originwebhook, with pusher and commitcipi-cli (SSH) or panel (API), with the operator

When to choose push to deploy#

  • A personal project, a prototype, an internal tool.
  • A staging app where fast feedback matters more than a gate.
  • A team that deploys many times a day and has good tests running elsewhere (pull request checks), so main is always green.
  • You don't want any server secret stored in a third-party CI.

Set it up: Auto-deploy on push.

When to choose a pipeline#

Set it up: CI/CD for Laravel.

The hybrid most teams end up with#

Two Cipi apps from the same repository, one per environment, each with its own branch and its own mode.

AppBranchMode
shop-stagingdevelopPush to deploy: every push is live on staging a minute later
shopmainPipeline: merge develop into main, tests run, then deploy
bash
# staging follows develop and keeps its webhook
cipi app create --user=shop-staging --domain=staging.shop.example.com \
    --repository=git@github.com:you/shop.git --branch=develop --env=staging
# production follows main; turn its webhook off and deploy from CI
cipi app edit shop --branch=main

Each app can read its own cipi-staging.yml or cipi.yml, so workers, crons and limits can differ.

Switching from one mode to the other#

From push to deploy to a pipeline#

Step 1 of 4Add the pipeline

Add the workflow for your CI and its secrets. Don't push yet.

Keep the agent installed: its health endpoint and MCP server are still useful.

From a pipeline back to push to deploy#

bash
composer require cipi/agent          # if the app doesn't have it yet; commit and push
sudo cipi deploy shop                # once, so the /cipi/webhook route exists
sudo cipi app webhook recreate shop  # re-create the webhook in the Git provider

Then remove the deploy job from your pipeline (keep the tests: they still protect pull requests).

Mistakes to avoid#

MistakeWhat happensInstead
Webhook and pipeline both onTwo deploys per push; the second hits the lock and failsOne mode per app
Rolling back whenever the deploy command failsA failed build publishes nothing; the rollback takes you to older codeRoll back only when the new release is live and unhealthy (why)
Giving CI a personal SSH keyLeaks your access with the CIA dedicated key, or an API token with deploy-manage
Calling the agent webhook from CI and expecting a resultCI turns green before the deploy even startsUse SSH or the API when CI must wait
No health URLA release that returns 500 counts as deployedSet cipi health set shop --url=https://shop.example.com/up

Troubleshooting#

ProblemFix
Push doesn't deploy (agent mode)Wrong branch, or no webhook: cipi git status, then cipi app webhook recreate shop
404 on /cipi/webhookThe agent isn't deployed yet: sudo cipi deploy shop once after adding it
Two deploys per pushTurn the webhook off for the app that uses a pipeline
"Deploy locked" in CILimit your CI to one deploy at a time; if nothing runs, sudo cipi deploy shop --unlock
Pipeline green, site brokenAdd the health check step from the recipes

Questions

Is one mode faster?

Push to deploy starts within a minute of the push. A pipeline starts the deploy after your tests, so it takes as long as the tests plus the deploy. The deploy itself is the same in both.

Is one mode more secure?

Push to deploy gives nobody access to the server: the Git provider only calls a signed URL on your app. A pipeline needs a secret on the CI side; with an API token limited to deploy-manage, the exposure is small.

Can I use both on the same app?

Not on the same branch: both would deploy every push, and the second one hits the deploy lock. Use one mode per app, or the webhook on staging and a pipeline on production.

Do I need the agent for pipelines?

No. Pipelines work over SSH or the API for every app. The agent is needed for push to deploy in Laravel apps.

What does the agent install in my app?

A Composer package with a few routes under /cipi: the deploy webhook, a health endpoint and, if you turn them on, an MCP server and a database anonymizer. See Install the agent.

Which mode do most people use?

Start with push to deploy: it takes two minutes and covers most apps. Move to a pipeline when a broken test has reached production once, or when the team grows.

Does the mode change how migrations run?

No. In both modes the server runs migrations inside the new release, before it goes live.

Can I deploy a specific commit?

Neither mode pins a commit: the server deploys the latest commit of the app's branch. Keep one deploy per branch at a time and it's the commit you just pushed or tested.

Try it on your own server

Free and open source. One command on a fresh Ubuntu 24.04 or 26.04 VPS.

wget -O - https://cipi.sh/setup.sh | bash
Read the quickstart