technical

Deploy a preview, then promote it to production

171 views

By default every deploy goes live: when a build finishes, Ngris makes it the current version straight away. If you would rather check a build before it reaches your visitors, you can instead deploy a preview — a fully built candidate that is not live — and promote it to production once you are happy with it. You can also roll back to an earlier version the same way.

Deploy a preview (don’t go live yet)

In the dashboard, when you upload a new build, tick “Deploy as preview — don’t make it live yet”. Ngris builds it exactly as normal and gives it its own preview URL, but your production URL is untouched — the version your visitors see does not change. Open the preview URL, verify the build, and only then promote it.

Promote a preview to production

On the app’s Deploys list, find the version you want to make live, open its ⋮ (more) menu, and choose Promote to production. That version instantly becomes the live one.

Roll back to an earlier version

Rolling back works the same way: on the Deploys list, open the ⋮ menu on an older version and choose Roll back to this version. It becomes live again. (A version whose build artifacts have been pruned by the retention policy can no longer be rolled back to — re-deploy from source instead.)

Do it via the API

When you create a deploy (upload a .zip or trigger a redeploy), pass activate=false to build it as a not-live candidate instead of going live:

POST /v1/applications/{uuid}/deploys      # multipart, field "file" = your .zip
# form field:
activate=false        # build a preview candidate; production is left unchanged

The field is optional and defaults to true (go live, unchanged behaviour). Any of false, 0, no, or off makes it a preview candidate.

To promote a candidate — or to roll back to any earlier built version — call the activate endpoint with that deploy’s UUID:

POST /v1/applications/{uuid}/deploys/{deployUUID}/activate

This works for any deploy that finished building (it does not have to be the newest one), so the same call both promotes a preview and rolls back to an older version.

You need a production endpoint to go live

“Live”, “promote”, and “roll back” only mean something once the app has a production endpoint (a domain attached to it). An app with no endpoint attached can still build deploys and give you preview URLs, but there is no production URL to promote to — attach a domain first to get a live production URL, then promote.

A note on Git deploys

Preview-then-promote (the activate=false flag) is a per-deploy choice for uploads and the API. If your app deploys from Git, a push to your production branch goes live automatically — unless you turn on Require manual promotion for the app, which makes every deploy (Git pushes included) build as a not-live candidate you promote by hand. See Require manual promotion.

Ask an AI to summarise this page