Deployments and previews
How pushes become deployments, how previews work, and how to redeploy, roll back and read logs.
What starts a deployment
| Trigger | What Lahyer does |
|---|---|
| A push to the production branch | Builds the commit and, once it is ready, serves it at your live address and custom domains. |
| A pull request opened or updated (a merge request on GitLab) | Builds the branch as a preview. |
| Deploy now on the project | Builds the production branch as it is now. |
| Redeploy on a deployment | Builds the same commit again, with the current settings and environment variables. |
lahyer deploy | Deploys the checked-out branch, or uploads a folder with --dir. See the CLI. |
| Publish in Lahyer Studio | Builds the Studio app as a deployment of its project. See Lahyer Studio. |
Statuses
A deployment moves through Queued, Building and Deploying, and ends Ready, Failed or Canceled.
- Queued: waiting for a build slot. Free organizations run one build at a time and Pro organizations three; the rest wait their turn.
- Building: installing dependencies and running your build command. The build log streams on the deployment's page.
- Deploying: putting the new version live.
- Ready: serving. For production, your live address now shows this deployment.
- Failed: the build or the start failed. The version that was live keeps serving, so a failed build never takes your site down. Choose Explain with Lahyer AI on the deployment for a summary of what went wrong and how to fix it.
Build time counts toward the organization's build minutes for the month: 500 on Free and 5,000 on Pro.
Previews
Every pull request gets a preview: Lahyer builds the branch and serves it at <project>-git-<branch>.lahyer.app. That address always shows the branch's newest ready deployment, so you can share it once and it stays current as you push.
- Previews use the preview values of your environment variables, so they can point at test services.
- A preview closes when its pull request is closed or merged, and on its own after 7 days without a new deployment.
- Previews never run cron jobs, take payments only with the test key, and do not count in visitor analytics.
Roll back and promote
Every ready deployment keeps its build, so moving production to it takes seconds and rebuilds nothing.
- Roll back to this deployment, on an earlier production deployment, makes it live again. The project's overview has a Roll back button for the previous one.
- Promote to production, on a preview deployment, makes that exact build live.
The next push to the production branch deploys as usual.
Logs
Build logs stream live while a deployment builds and are kept for 90 days after it finishes. Values of your environment variables are masked in them.
Runtime logs are your server app's output (stdout and stderr), on the project's Logs tab. Pick production or a preview, a range from the last 15 minutes to the last 7 days, and filter by text. Static sites have no runtime logs: there is no server process.
From the terminal:
lahyer logs --follow # the latest build, live
lahyer logs --runtime --follow # the running app's output, live
lahyer logs --runtime --range 24h --q "timeout"On the Logs tab, Explain with Lahyer AI reads the lines in view and explains them; you can add a question first.
Server apps at rest
A server app sleeps after five quiet minutes and wakes with the next request, so the first request after a quiet spell can be slower. On Pro, one production app per organization can stay always on. Production apps on Pro also scale out to three copies under load. See Plans and limits.