From a push to live, with no downtime.
Push to a branch and the site builds and goes live with no downtime. The new version starts beside the old one, traffic moves once it answers its health check, and the old one is retired. A build that fails leaves the live version serving.
In the panel: Connect GitHub installs our GitHub App on your account or organisation, and the new-site page lists your repositories. Private repositories work. A pasted address works for GitLab and other hosts.
From the terminal: a new site from a repository, or connect an existing site.
lh create shop --repo you/shop --branch main
lh connect shop you/shop --tags 'v*' # release only tags like v1.2.0
lh connect shop you/shop --previews # a preview site per pull request
From code: POST /builds/sites makes the site and returns its first build; PUT /builds/sources/{slug} connects or changes the repository, branch, folder, Dockerfile path and trigger. See Git deploys in the reference.
What goes live. By default every push to the branch. With trigger: tag only tags matching the pattern go live and branch pushes build nothing; lh deploy shop --tag v1.2.0, the panel's Deploy tag, or a CI job posting {"site": "shop", "tag": "v1.2.0"} releases one by hand.
Every connected site has its own hook address, https://localhost.co.zw/hooks/git/<site id>/, with a secret shown on the site's page. GET /builds/sources/{slug} returns the address as webhook_url. It understands:
| Sender | How it signs | Events |
|---|---|---|
| GitHub (without the App) | X-Hub-Signature-256 | push, pull_request |
| GitLab | X-Gitlab-Token | push, tag push, merge request |
| Gitea, Forgejo | X-Gitea-Signature | push |
| Your CI job | X-LH-Signature: sha256=<HMAC of the body with the secret> | body {"branch": "main", "sha": "…"} or {"tag": "v1.2.0"} |
Pushes to other branches, deleted branches, a commit already built, and commit messages carrying [skip deploy] or [skip ci] build nothing.
Turn previews on and each pull request from the same repository gets its own site at <site>-pr-<n>.sites.localhost.co.zw: built when it opens and on every push, removed when it closes or merges. It gets the main site's settings except the database address and anything lh.toml lists under previews.hide, plus PREVIEW=1, PREVIEW_PR and PREVIEW_BRANCH. Pull requests from forks never get one. With the GitHub App the preview shows as a commit status and one comment on the pull request. lh previews shop lists them; the API has GET /builds/previews?site=shop.
The last few live builds stay on the server, so going back is instant: lh rollback shop puts the previous live build back, --to 12 a particular one; the API has POST /builds/{id}/rollback. A rollback is a build of its own, with rollback_of set, so the history stays honest.
A site's settings (lh env, /sites/{slug}/env) reach the app at run time. Mark one build and the build gets it too, for the NEXT_PUBLIC_* and VITE_* kind of thing; those are never secret. Mark one live-only and previews don't get it. Settings shared by every site live under /variables (lh env --all) and a site's own value wins over a shared one.