Guides

Stages

Run one project in several stages, for example Development, QA and Production. A build moves from stage to stage by promotion, the same image without a rebuild, with an approval before a stage where you want one.

A stage is a separate environment of one project. Each stage has its own project ID, its own secrets, domains, databases and data, its own RAM and its own monthly budget. The stages share the project’s name and stand in a fixed order, the stage flow. You choose the names, for example Development, QA and Production, and a project has up to ten stages.

Stages are part of the Business and Enterprise plans, see Plans and limits.

Create a stage

Project admins set up stages in the console, in the project’s Settings under Stage flow. The flow shows every stage as a card, in order from left to right. The plus at the edge or on the arrow between two cards adds a stage at that position: before the first, in between, or after the last.

For a new stage you set:

  • Name. 1 to 40 characters, unique within the project. If the project had no stages so far, you also name the existing project as a stage.
  • Source. Where a new state comes from, see Choose the source.
  • Take over apps. The new stage starts with the apps of its neighbour, with the same image. Volumes start empty. Secrets, custom domains and data are not copied: create them in the new stage before you expect its apps to run.

Apps with a repository and deploy/ are taken over like a promotion. Apps that were deployed without a repository are applied again from their manifests, and they do not get into a stage that only takes promoted states. The card shows per app whether it was taken over and offers Try again. A stage that is still empty offers Take over apps from ….

The menu of a card holds Name and source and Remove stage. Removing a stage deletes it with all apps, secrets, domains, backups and data and cannot be undone. The other stages stay. If you remove the first stage, the next one becomes the first and takes pushes directly.

Choose the source

Every stage takes new states from one source:

Source What rolls out there
Push, branch per app The default for the first stage. Every app builds on a push to its own branch, as in a project without stages, see Deploy on push.
Push to a branch A push to this one branch builds every app in the stage.
A new tag A tag that is newly created in the repository and matches the pattern, for example v*, builds the commit it points to, whichever branch that commit is on.
Only from the pipeline For the first stage. Only releases from your pipeline (nyx release) roll out, see Release from any CI.
Promoted from the stage before The default for every stage after the first. Nothing is built there and nothing is deployed there directly.

About the tag source: in the pattern, * matches any characters except a slash, so tags like release/1.4 need release/*. A new tag is picked up within about a minute. Tags that already exist when you choose the source are not built, and moving an existing tag builds nothing. A push to a branch builds nothing in that stage either.

A stage after the first that has a branch or a tag as its source builds on its own. It has no approval gate.

Promote

Promoting hands the state that runs for one app in a stage to the next stage of the flow. Nothing is built: the same image, with the same digest, is copied to the next stage, and deploy/ of the same commit is applied there. What ran in QA is exactly what reaches Production. A stage is never skipped.

Secrets, domains and data never travel. Set the next stage’s secrets and domains there, with that stage’s values, before the first promotion.

An app can be promoted when its state lives in a repository: the repository is connected, the app’s configuration comes from deploy/ in it (see Configure your app from the repo), and the running build belongs to a commit nyxory knows. Otherwise the promotion is refused, with a code that names what is missing:

Code Meaning
no_source the app has no connected repository
no_repo_config the app’s configuration does not come from deploy/ in its repository
commit_unknown nyxory does not know the commit of the running build; roll the app out once through a push
image_not_found the running image is no longer in the registry; roll the app out again
image_outside_project the running image is not in the project’s registry
no_next_stage this is the last stage, or the project has no stages
gate_required the next stage has no approval, so only project admins and the pipeline promote to it

There are three ways to promote. All of them name the stage the state comes from.

In the console. Open Deployments in the project. The panel Which build runs where lists every app with the build that runs in each stage. Promote to … under a build hands it to the next stage.

With the CLI.

nyx promote nyx-abc123 web

nyx-abc123 is the project ID of the stage the state comes from, web is the app. The command waits until the release is live in the next stage. It exits 0 when it is live, 1 when it failed or was refused, superseded or replaced, and 2 when it is still running after --timeout (default 15m). With --no-wait it returns once the promotion is accepted.

Your pipeline can promote the same way, with its deploy token in NYX_TOKEN or from GitHub Actions. That is how a pipeline promotes after its own tests against the stage passed. nyxory runs no tests between stages. With a pipeline credential the command does not wait for the rollout, because the credential reaches only its own stage.

Through your coding agent. Ask it to promote the app. Over MCP the agent calls:

nyx_project {action: "promote", project: "nyx-abc123", app: "web"}

The answer names the next stage and the release there. The agent follows it with nyx_app_get and view: "releases" on the next stage. nyx_project_state shows the agent the stages of a project in flow order, with source and approval.

Approval before a stage

A stage that takes promoted states can require an approval. A project admin sets it in the stage flow, with a click on the gate on the arrow before the stage: No approval or An admin approves, and optionally Four eyes.

  • Without approval a promoted state rolls out at once. Only project admins and the app’s pipeline can promote to that stage.
  • With approval a promotion is a request, and every workspace member can make one, the coding agent and the pipeline included. The state waits in the next stage, and what runs there stays.

A project admin decides a waiting state in the console, in the stage flow with Open approval or on the app page of that stage under Releases. An approval needs a reason and is recorded in the history with name and reason. Discarding leaves the running state as it is. An agent, a token or a pipeline cannot approve.

With Four eyes, whoever requested the promotion cannot approve it; another admin has to. A request from a coding agent counts as a request from the person it works for, a request with a deploy token as one from the admin who created the token. If the project has only one admin, the console warns that nobody can approve what this admin requests.

Also good to know:

  • A newer request for the same app replaces one that still waits. A waiting request can only be approved while the stage still runs what it ran when the request was made.
  • nyx promote returns with exit code 0 once the request is made. It does not wait for the decision.
  • Request and decision go to the alert channels of that stage.
  • A rollback in a stage with approval waits for approval like a promotion.
  • The first stage has no approval, and neither has a stage with a branch or a tag as its source.

Limits

  • A project has at most ten stages. Every stage takes RAM from the account pool.
  • Stages are created and configured in the console only. The CLI and the MCP tools promote and show stages, but they do not create a stage and do not change source or approval.
  • A promotion moves one app to the next stage. There is no promotion of a whole project in one step and no skipping of a stage.
  • Apps without a repository and deploy/ cannot be promoted.
  • Secrets, domains and data are never copied between stages.
  • In a stage that only takes promoted states, a direct build or deploy by the agent, a release from the pipeline and a push are refused or do nothing. Logs, secrets and a rollback to an earlier release of that stage keep working.
  • An approval is a person’s decision. nyxory does not run tests or checks of yours as a condition for a stage.

Related: Deploy on push · Release from any CI · Configure your app from the repo · nyx CLI reference

Ask any AI about nyxory