Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Deploy
  3. Customize the pipeline

Customize the pipeline

Deploy options and your own Deployer tasks.

Deploy

Most apps never touch the deploy recipe: the options below cover the common needs and are kept safely across updates. For anything else, add your own Deployer tasks.

Deploy options#

bash
cipi app deploy-config myapp                                  # show
cipi app deploy-config myapp --keep-releases=10
cipi app deploy-config myapp --no-migrate --no-optimize
cipi app deploy-config myapp --horizon-terminate --queue-restart
cipi app deploy-config myapp --extra-artisan=view:clear,event:cache
cipi app deploy-config myapp --node-build='npm ci && npm run build'
cipi app deploy-config myapp --predeploy-snapshot
OptionEffectDefault
--keep-releasesReleases kept for rollback5
--migrate / --no-migratemigrate --forceon
--optimize / --no-optimizeartisan optimizeon
--storage-linkstorage:linkon
--queue-restart, --horizon-terminateReload workers / Horizonon
--extra-artisanMore Artisan commands after migrationsnone
--node-buildFront-end build before the swap (npm, yarn, pnpm, bun)none
--predeploy-snapshotDatabase dump before migrationsoff

Saving regenerates deploy.php from Cipi's template. Also via REST (GET|PUT /api/apps/{name}/deploy-config), MCP and the panel's Deploy tab. The same settings can live in cipi.yml.

Custom Deployer tasks#

The recipe is /home/myapp/.deployer/deploy.php. Add tasks at the bottom, below the Cipi-managed blocks:

php
// ── Custom tasks (keep below Cipi-managed blocks) ──
task('app:warm', function () {
    run('{{bin/php}} {{release_path}}/artisan app:warm-cache');
});
after('artisan:migrate', 'app:warm');
Hook pointUse for
after('deploy:shared', …)Builds that need .env (e.g. Vite reads VITE_*)
after('artisan:migrate', …)Seeders, cache warm-up
before('deploy:symlink', …)Last checks before going live
after('deploy:symlink', …)Notifications, cache purges

The default order: prepare → vendors → shared → (build) → migrate → optimize → storage link → symlink → restart workers → cleanup.

Changing PHP or branch with cipi app edit regenerates deploy.php. Keep custom tasks in one clearly marked block at the bottom and back it up, or prefer deploy-config and cipi.yml, which are never lost.

Test every change with a normal deploy; cipi deploy myapp --rollback is always one command away, and the log is in cipi app logs myapp --type=deploy.