Deployments

Deploy scripts, zero-downtime releases, rollbacks and push to deploy.

Guides

Write and test a deploy scriptThe deploy script is the list of commands that runs on every deployment. Learn where it lives, what it can use, how a failure is reported and how to change it safely.Deploy automatically on every pushTurn on push to deploy so a push to your branch starts a deployment by itself. See how the webhook is registered and verified, what is ignored, how queued deployments behave and what to do when pushes do nothing.Deploy without downtime and roll back to an earlier releaseUnderstand how a zero-downtime site builds each version in its own folder and switches over in one step, how many releases stay on the server, and how to go back to one in seconds when a deployment goes wrong.Read a deployment log and find the failing stepOpen a failed deployment, read its two log panels from the bottom up, use the AI explanation as a hint, and recognise the usual failures: Composer, migrations, Git access, out of memory and failed health checks.Set up health checks, release retention and deployment alertsCheck that the site answers after every deployment, choose how many releases stay on the server, share folders between releases and get told by email, Slack, Discord, Telegram or a webhook when a deployment fails.Build front-end assets with Vite, npm, pnpm, Yarn or BunChoose the package manager and build command, see what the generated deploy script runs, store a token for a private registry and fix common build failures such as a missing Node or an out-of-memory kill.Deploy from GitHub Actions and other CIStart a deployment from a pipeline with the secret deploy hook address or with the API, wait for the result, read the exit status in CI and keep the credentials out of your repository.Deploy now, redeploy and switch branchesStart a deployment by hand, repeat one after a fix, cancel or unstick one, and change which branch a site deploys. Also what SrvYard cannot do: deploy an arbitrary older commit.

Frequently asked

What does a deploy script do, and how long may it run?

It holds the commands run on every deployment, such as installing dependencies, building assets and migrating. SrvYard writes a sensible one for your site type and you can edit it. A script that runs longer than 780 seconds is stopped. See Write and test a deploy script.

Can I deploy automatically when I push?

Yes, with push to deploy, for repositories on a connected GitHub, GitLab or Bitbucket account. SrvYard registers a signed webhook for you. A Custom Git URL has no connection to create one, so use the deploy hook instead. See Deploy automatically on every push.

Can I deploy a specific older commit?

No. SrvYard always deploys the latest commit of the site's branch, and there is no commit field. To get another version live, roll back on a zero-downtime site or change the branch. The article lists the options. See Deploy now, redeploy and switch branches.

What is a zero-downtime site, and can I change it later?

Each deployment builds in a fresh folder and the site switches to it in one atomic step, so visitors never see a half-built version. It is chosen when the site is created and cannot be changed afterwards. See Deploy without downtime and roll back to an earlier release.

Does a rollback undo database changes?

No. A rollback only points the site at an earlier release. Migrations that already ran stay, and a cache or queue payload from the newer code can still cause trouble, so check those too. A rollback needs a zero-downtime site. See Deploy without downtime and roll back to an earlier release.

If a deployment fails, does my site go down?

Not if it fails before the switch. On a zero-downtime site the previous release keeps serving and the half-built one is removed. A failed health check is different: the new release is already live, so fix it or roll back. See Read a deployment log and find the failing step.

How do I deploy from GitHub Actions or another CI system?

Request the secret deploy hook address with curl, or use the API with a token that has the sites:manage-deploys scope if you want to wait for the result. Do not combine either with push to deploy unless you want two deployments. See Deploy from GitHub Actions and other CI.

Why were my front-end assets not built?

Usually Node or the chosen package manager is not installed on the server, or the repository has no matching lock file, because the install step is the strict kind (npm ci). Set it up on the Runtimes tab. See Build front-end assets with Vite, npm, pnpm, Yarn or Bun.