grounds push --target=staging creates a preview environment: a fresh namespace, a fresh deployment, and a public URL. They’re built for sharing — review apps, demos, end-to-end test runs against a real cluster.
For the step-by-step staging workflow, see
Share staging previews.
Anatomy of a preview env
The TTL clock starts at preview creation, not at push completion. A pinned preview has no TTL.
Listing your previews
--include-deleted to see envs that were swept by the janitor.
Pinning
Pinning skips the TTL janitor — the env stays alive until you unpin or delete it explicitly. Useful for long-running demos or a staging environment a non-developer is using.Lifecycle internals
When you push tostaging, forge:
- Builds your image (same as
dev). - Creates a
PreviewEnvrow with a generated short ID. - Provisions a
preview-<id>namespace with quota + default-deny NetworkPolicy. - Deploys the workload into that namespace.
- Configures an ingress at
<name>-pr<id>.mc.grnds.io(Minecraft workloads) or…dev.grnds.io(serviceworkloads).
PreviewJanitor runs every 30 minutes:
- Lists all
PreviewEnvrows whereexpiresAt < now() AND deletedAt IS NULL AND pinned = false. - Deletes the namespace (which cascades the deployment, ingress, etc.).
- Sets
deletedAton the row so it stops being considered.
grounds preview list --include-deleted will show them.
When not to use staging
- Inner-loop iteration on your own machine — use
groundsTestLocalinstead. It’s offline, free, and 5 seconds per cycle. See Local development. - Long-lived dev environments for one person — that’s what
--target=devis for. It doesn’t burn a fresh namespace per push.
