Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Home
  2. Guides
  3. Push-to-deploy Laravel from GitHub, GitLab, Bitbucket or Gitea
Cipi Agent & AI

Push-to-deploy Laravel from GitHub, GitLab, Bitbucket or Gitea

Deploy on every git push with signed webhooks verified inside your app, branch filtering, an audit trail of who pushed, and deploys that never run inside a web request.

By Updated 2 min read

With a token, Cipi sets up the webhook on GitHub, GitLab, Bitbucket and Azure DevOps by itself. This guide shows what happens behind it, and how to wire Gitea or Forgejo by hand.

Key ideas, in plain words#

TermMeaning
WebhookAn HTTP call your Git provider makes on each push
SignatureA hash of the request made with a shared secret, proving it came from your provider
TriggerA small file the webhook leaves; a cron starts the deploy from it
Step 1 of 5git push

You push to the app's deploy branch. Other branches are ignored.

The request never runs the deploy itself: it verifies the push and drops a trigger. A cron picks it up and deploys with zero downtime. A slow build can't time out a webhook, and a forged request can't start anything.

1. Get the URL and token#

bash
sudo cipi deploy shop --webhook

2. Add the webhook#

ProviderPayload URLSecret / tokenEvents
GitHubhttps://shop.example.com/cipi/webhookSecret = token (HMAC-SHA256), content type JSONJust the push event
GitLabsameSecret tokenPush events
Bitbucket CloudsameSecret (HMAC)Repository push
Gitea / ForgejosameSecret (HMAC)Push events

Only pushes to the app's branch (CIPI_DEPLOY_BRANCH) deploy; others answer skipped. GitHub's ping answers pong.

3. Push and watch#

bash
git push origin main
sudo cipi deploy shop --status      # running, queued or idle
sudo cipi deploy shop --log

4. Know who pushed#

Each trigger records what the push claimed (provider, pusher, commit, delivery ID, IP) in the deploy audit. It's recorded as a claim, not a fact: the ledger is hash-chained, so it can't be quietly edited later.

bash
sudo cipi deploy shop --audit

Rotate the secret#

bash
sudo cipi app webhook recreate shop --rotate-secret

Need tests before deploying? Turn the webhook off and use a pipeline.

Troubleshooting#

ProblemFix
Provider shows 401/403Secret or token mismatch: copy it again from cipi deploy shop --webhook
200 but no deployPush to a branch that isn't the deploy branch
Deploy starts a minute laterNormal: the cron picks the trigger up within a minute
Nothing at all reaches the serverWebhook URL wrong, or the app is behind Zero Trust without a bypass rule for /cipi/webhook

Questions

Does a push to another branch deploy?

No. Only pushes to the app's deploy branch (CIPI_DEPLOY_BRANCH) trigger a deploy; others are acknowledged and ignored.

What if two pushes arrive at once?

Deploys are serialized per app: the second waits, then deploys the newest commit.

Is the webhook safe on a public URL?

Yes. Every request must carry a valid signature or token; anything else is refused before any work starts.

What if a step fails?

Read the troubleshooting table above first. Then check the matching docs page, open a GitHub issue, or ask in the community. Most commands print the fix when they refuse something.

Do I need the web panel for this?

No. Every step works from the CLI. The optional web panel shows the same things in a browser.

Can I run these commands from my laptop?

Many of them, through cipi-cli and the API, with a scoped token. Otherwise ssh cipi@your-server and use sudo cipi ….

Will this affect other apps on the server?

No, unless the step says it's server-wide (installing a PHP version, firewall, Cloudflare tunnel). Each app has its own user, PHP pool, database and Valkey.

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