Previews
Automatic deployments for pull requests and feature branches
Previews enable automated deployments, triggered by pull requests and feature branches. They allow you to test changes in isolated environments before merging to your main branch. When you create a pull request, Ryvn automatically deploys your changes using blueprints, giving you a live preview of your application.
How Previews Work
Previews are automatically triggered by GitHub webhooks when pull requests are opened, updated, or closed. Ryvn will create a unique blueprint installation for the preview and allow you to stand up a single or multiple services, depending on what your blueprint contains. Each preview is destroyed after the pull request is closed or merged or if there is no new activity for 7 consecutive days.
Previews may continue to incur additional infrastructure costs if you have a large number of PRs being opened and not being closed.
Enabling Previews
Configure Preview
Define previews in your ryvn.yaml
file with a blueprint and target environment. Make sure the target environment
supports cluster auto-scaling.
Create Pull Request
Automatic Deployment
Ryvn detects the PR and automatically deploys your changes using the preview configuration.
Test & Review
Cleanup
Using Previews
Previews are configured in your ryvn.yaml
file alongside your blueprints and environments. Here’s an example of a preview configuration:
See ryvn.yaml
Preview Reference for detailed information about all the preview fields.
Preview Configuration
Each preview requires three main components:
Preview Properties
Property | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the preview. Must be lowercase alphanumeric with hyphens, max 63 characters. |
environment | string | Yes | Name of the environment where previews will be installed. |
fromBlueprint | object | Yes | Blueprint configuration for the preview. |
Environment Selection
The environment
field specifies where your preview will be deployed. This should typically be a dedicated environment
for previews that is using an auto-scaling cluster.
Avoid using production environments for previews to prevent accidental exposure of untested changes and resource contention.
Blueprint Configuration
The fromBlueprint
configuration is similar to environment installations but with preview-specific inputs:
Automating URL Generation
Each preview can get a unique URL assigned if your installation uses the correct ingress configuration that generates unique URLs. See the example below: