How Deploying Works
Learn how Ryvn handles application deployments
Ryvn makes deploying your services as simple as pushing code to your repository. Here’s how it works.
Automatic Git Deployments
By default, Ryvn automatically deploys your service whenever changes are pushed or merged to the linked branch. Learn more about deploying from GitHub. This behavior can be customized in several ways:
Skipping Deployments
To skip deployment for a particular commit, include one of these phrases in your commit message:
Disabling Auto-Deploy
You can disable automatic deployments entirely:
-
Navigate to your service settings
-
Set
auto_deploy
tofalse
in your configuration
Deployment Process
Each deployment follows this sequence:
Build
Executes your build command. Compiles code and installs dependencies. Times out after 120 minutes.
Instead of building from source, you can also deploy directly from a container registry or push your images to Ryvn’s built-in registry.
Pre-Deploy
Executes your pre-deploy command. Runs optional tasks that should precede deployment but aren’t tied to building your code, such as database migrations. Times out after 30 minutes.
Deploy
Executes your start command. Starts new service instances and verifies health. Times out after 15 minutes.
If any step fails or times out, the deployment is canceled and your service continues running the last successful version.
Build Command
The build
command performs all compilation and dependency installation. Examples for different runtimes:
Runtime | Example Commands |
---|---|
Node.js | yarn , npm install |
Python | pip install -r requirements.txt |
Go | go build -tags netgo -ldflags '-s -w' -o app |
Docker | Uses Dockerfile or pulls from registry |
Pre-Deploy Command
The pre-deploy
command runs after your service is built but before your service is deployed. Use it for tasks that
should always precede a deploy but aren’t tied to building your code, such as database migrations.
Pre-deploy commands run in a separate environment from your service. Changes to the filesystem here are not reflected in the deployed service, and you cannot access persistent storage.
Start Command
The start
command runs your service. Examples for different runtimes:
Runtime | Example Commands |
---|---|
Node.js | yarn start , node index.js |
Python | gunicorn app:app |
Go | ./app |
Docker | Uses CMD from Dockerfile |
Zero-Downtime Deployments
During deployments, Ryvn keeps your service available by running both old and new versions simultaneously. Traffic only shifts to new replicas after they’re verified healthy, ensuring your users never experience downtime. Learn more about zero-downtime deployments.
Health Checks
Health checks are essential for zero-downtime deployments. For servers, Ryvn verifies each replica is ready before routing traffic to it. If health checks fail, Ryvn keeps traffic on existing replicas and cancels the deployment. Learn more about configuring health checks.
Managing Deployments
Canceling a Deployment
You can cancel an in-progress deployment from the dashboard. The service will continue running its current version.
Restarting Services
When you restart a service:
-
Ryvn deploys a fresh instance
-
Maintains zero-downtime during restart
-
Uses current configuration and environment variables
-
Restarts all instances for scaled services
Filesystem and Data
By default, service filesystems are ephemeral - changes are lost between deployments. To persist data:
-
Use a database service
-
Attach persistent storage
-
Use object storage for files
Learn more about different service types and their capabilities.
For more advanced deployment scenarios, check out: