What this covers
A static page is an HTML site deployed directly from a git repository with no container involved. Levelrail Pages fetches your code, publishes the built files to a local directory, and routes traffic to them through the embedded Caddy ingress. No build packs or Dockerfiles needed. This page covers deployment, domains, rollback, and deletion.Deploy a static site from git
Inapp.yaml, set build.type: static and optionally build.path to point to the directory containing your finished HTML:
app.yaml with a static service, the deploy trigger will pick it up automatically.
How static pages are built and deployed
Unlike container-based apps, there is no container build step. The deploy process is:- Fetch: Clone or pull the repository at the commit you push.
- Publish: Copy the specified
build.pathdirectory to a local directory on the control plane. The files are stored in a content-addressed path under the control plane’s data directory (<data dir>/static/SERVICE/COMMIT, with the data directory defaulting to/var/lib/levelrail-data). - Route: The ingress controller points the configured domains at this directory. Traffic routes immediately once the files are published.
Domains and TLS
Static sites declare domains the same way container apps do, in thedomains list or from the Domains tab:
Rollback a static site
Levelrail Pages keeps the built files from every deploy by storing them with the commit SHA as part of the path. To roll back:Delete a static site
Deleting the app removes the site, its files and its route right away:levelrail-cli static-sites delete my-site. It returns 404 if the site does not exist and 409 if the app still needs it.
If a site is ever left behind without an app, a background sweep removes it after a grace period. The default is 10 minutes. Set APP_STATIC_ORPHAN_GRACE (for example 1h) to change it. An empty or 0 value falls back to the default.
List your static sites
From the CLI:Limitations
- Build languages: Levelrail Pages does not run a build step. Your repository must contain the finished HTML in the path you specify. If you use a static site generator (Hugo, Jekyll, Next.js static export and so on), build in CI and push the output to a branch, then deploy that branch with
--ref. - Redirects and rewrites: The embedded Caddy serves files as-is. URL rewrites and sophisticated routing are not configured. If you need them, run a small container service for the site instead.
- Large file limits: There are no hard limits, but very large directories (> 1GB) may see slower deploy and rollback times. Monitor the data directory disk usage with
df -h /var/lib/levelrail-data.
For contributors
Where static pages live in the source
Where static pages live in the source
- Deploy logic:
internal/deploy/static.go - Storage:
internal/store/static_site.go, migrations0015_static_sites.sql - Ingress routing:
internal/reconcile/ingress/controller_static_test.go(controller tests; no separate impl file) - API:
internal/api/static_sites.go - CLI:
cmd/levelrail-cli/static_sites.go