Skip to content
Console
On this page

Deploys

How code reaches production, and how to undo it.

A deploy is not a command. A push to the branch a Service ships from is read by the platform, built, released and rolled out — and each of those stages is something you can watch and, where it matters, stop.

What a push starts

  1. Source. Sylphx reads the exact commit you pushed.
  2. Build. The commit becomes an image identified by its digest.
  3. Release. The release records the build and configuration for the environment.
  4. Rollout. Sylphx deploys the release. Check the environment’s deployment status before sending traffic to the new version.

Watching a deploy

Each environment has a status and a history. Read them with the environment's id (env_…):

Shell
sylphx api GET /v1/deployments/projects/$ENV_ID/status
sylphx api GET /v1/deployments/projects/$ENV_ID/deployments
sylphx api GET /v1/deployments/builds/$BUILD_ID
sylphx api GET /v1/projects/$PROJECT_ID/logs

status is running once the app is live and unhealthy when the deploy failed. A build names its commit, its image and its timing, and the logs say why a deploy stopped.

Start one by hand

A push starts a deploy by itself. To start one without a push:

Shell
sylphx api POST /v1/projects/$PROJECT_ID/deploy -d '{"envType":"production"}'

force rebuilds even when the commit has not changed, and serviceName limits the deploy to one service.

Redeploy and roll back

A redeploy mints a new Release from the environment's current commit. Pass a commit to deploy a commit that has already been built; one that is not fully built is refused, and so is a redeploy while another release is in flight.

Shell
sylphx api POST /v1/projects/$PROJECT_ID/environments/$ENV_ID/deployments/redeploy -d '{"commit":"<sha>"}'

To undo the last deploy, roll back. One call puts the previous deploy's artifacts back without a build, keeps your current environment variables, and records your reason:

Shell
sylphx api POST /v1/projects/$PROJECT_ID/environments/$ENV_ID/deployments/rollback -d '{"reason":"5xx after deploy"}'

The commit you rolled back from is not deployed again by itself; your next push, or a redeploy, moves the environment on.

Rolling back is not a revert

The Release names older digests, so the code is what it was. The database is not: migrations that ran since are still applied. Migrations has the shapes that survive a rollback.

Pause an environment

Pausing stops new deploys from moving the environment while you investigate:

Shell
sylphx api POST /v1/projects/$PROJECT_ID/environments/$ENV_ID/deployments/pause -d '{"paused":true,"reason":"investigating an incident"}'

{"paused":false,"reason":"…"} lets deploys move again, and a GET on the same path reads the current state.

Previews

An environment of type preview is where pull-request deploys land. A project is created with one, and preview databases are branched per environment with /v1/projects/$PROJECT_ID/preview-envs/$ENV_ID/branch-db. Give a preview its own data — a preview that writes to the production database is a production deploy with extra steps.

Custom domains

A domain belongs to a project and is attached to an environment. Add the domain, then attach a hostname to a service:

Shell
sylphx api POST /v1/projects/$PROJECT_ID/domains -d '{"apexDomain":"example.com","envType":"production"}'
sylphx api POST /v1/projects/$PROJECT_ID/domains/$DOMAIN_ID/hostnames -d '{"hostname":"shop.example.com","serviceId":"$SERVICE_ID","isPrimary":true}'
sylphx api POST /v1/projects/$PROJECT_ID/domains/$DOMAIN_ID/hostnames/$HOSTNAME_ID/check

check reads the DNS records now. Certificates are issued and renewed once the hostname is verified. The full walk-through is the Network quickstart.

Self-hosted runners

For GitHub Actions jobs on Sylphx or machines you manage, see Runners.