Pipelines

Pipelines enable you to automate the entire process of moving code from development to production. You can define multiple stages within your pipeline and include multiple applications in each stage. Once your pipeline is set up, the Promote feature allows you to seamlessly push changes from the source code to QA and production environments without the need to rebuild the application. Pipelines also support the Git Flow strategy, providing a clear visual representation of your application’s development and deployment workflow.

With pipelines, you can:

  • Deploy software with different environment variables: This is ideal for scenarios like a B2B application used by multiple customers, where each customer requires slight variations in their dashboard.
  • Deploy the same application across multiple geographical locations: This helps improve performance and reduce latency for users in different regions.
  • Run A/B tests: Easily deploy different versions of your application to targeted user groups so you can test which version delivers better results.

Using pipelines streamlines the deployment process, enhances flexibility, and supports a structured approach to managing multiple environments.

The Promote feature is also accessible through our API, making it easy to integrate with third-party CI/CD tools like GitHub Actions for streamlined workflows.

Add a pipeline

To add a new pipeline, click Add pipeline within Applications.

Add a new pipeline within Applications.
Add a new pipeline within Applications.

Enter a name for the pipeline and choose one of the following:

  • Trunk-based development: With a trunk-based development pipeline, you can add an existing application to your development stage and create multiple production environments as separate applications for deployment. Each of these applications can be hosted in different data centers and is treated as an independent entity within its own container. This setup allows you to deploy multiple applications from the same source code but with distinct environment variables, domains, processes, and other configurations.
  • Git flow: Choose this option if your workflow uses separate branches for development, staging, and production. To use the Git Flow pipeline, your applications must already be set up within MyKinsta. This approach lets you visually manage and track your Git Flow directly in the platform. The Promote feature is not available in this workflow, as deployments occur automatically when you push changes from your Git source repository.
Choose the development strategy for your pipeline.
Choose the development strategy for your pipeline.

You also have the flexibility to add multiple stages to the pipeline, such as a QA stage, to thoroughly test your changes before promoting them to production.

Click Add pipeline, and this opens the pipeline workflow where you can add your stages and applications.

Application pipeline workflow.
Application pipeline workflow.

Enable preview apps

Enabling preview apps allows you to test your changes in a live environment before merging them into the main branch. Preview apps are integrated with GitHub’s deployment and environment features, so when you open a pull request, a preview app is automatically generated, providing a dedicated testing space that mirrors your production setup. This lets you review, interact with, and refine your updates to ensure your code works as intended before it’s fully integrated into the main project.

When you click Enable preview apps, the following options are available:

Preview settings

  • Git repository: Choose GitHub, Bitbucket, or GitLab and connect your Git account. Once connected, you can choose a Git repository.
  • Automatically create new preview apps for each pull request: Select this option to create a new preview app each time you open a pull request. The preview app is deleted when the pull request is closed.
  • Delete stale preview apps automatically: Select this option to automatically delete preview apps when no new deployments occur. You’ll need to specify the number of days without any new deployments before the preview apps are scheduled for deletion.

App settings

  • Location: Choose the data center you want to use for this application.
  • Build type: Choose Nixpacks, Buildpacks, or a Dockerfile.
  • Build path: For Nixpacks and Buildpacks, this is the path in the repository to the files required to build the application. For Dockerfiles, this is the path to your Dockerfile relative to the repository root.
  • Hibernation: This automatically scales down your application if no HTTP requests are received within the specified timeframe.

Processes

In this section, you can add any necessary background workers, cron jobs, or jobs.

Environment variables

Add any required environment variables for your preview app.

Preview app settings.
Preview app settings.

Once you’ve added the required details, click Enable.

To change the settings of the preview app, click the ellipsis on Preview, and select Update settings. To manually deploy the preview app, click the ellipsis on Preview, and select Deploy branch.

Manually deploy your preview app or update the settings.
Manually deploy your preview app or update the settings.

Add an app to a stage

To add an application to a stage, click Add app. You can then choose to add an existing application or create a new one. You can only create a new application within the trunk-based development pipeline. If you’re using the Git Flow pipeline, the applications must already exist within MyKinsta.

Add an application to a stage in the pipeline.
Add an application to a stage in the pipeline.

For trunk-based pipelines, the first stage of your pipeline should be the source for the rest of the pipeline, so you must choose an existing application. You can then choose to create a new application for any of the following stages.

Application pipeline with two production environments.
Application pipeline with two production environments.

Add a stage

To add another stage to the pipeline, click the ellipsis and then Create stage.

Create a new stage in your pipeline.
Create a new stage in your pipeline.

Enter a name for the stage and click Create stage. You can drag and drop the stages to change the order in which you want to deploy the application.

Add a name for the stage and change the order.
Add a name for the stage and change the order.

You can then add a new application to the stage.

Application pipeline with a QA stage.
Application pipeline with a QA stage.

Promote changes to production

If you’ve set up a trunk-based pipeline, you can use the Promote option to push the application to each stage without having to rebuild it. If you’re promoting to a stage with multiple applications, you can choose which applications to promote to. If you don’t want to promote a particular application, click the minus sign on that application to remove it from the deployment.

Promote your changes to multiple applications.
Promote your changes to multiple applications.

Within Applications, the pipeline displays all the included applications, clearly labeling the stage each application is in within the pipeline and when it was last deployed.

Applications pipeline.
Applications pipeline.

Pipeline settings

To access the pipeline settings, click the ellipsis within a pipeline and then click Settings. The settings allow you to switch between trunk-based development and git flow pipelines. You can also update the name of your pipeline and change the order of the stages within the pipeline.

Application pipeline settings.
Application pipeline settings.

Delete a pipeline

To delete a pipeline, within Applications, select the pipeline you want to delete, click the ellipsis, and then click Delete.

Delete an application pipeline.
Delete an application pipeline.

This only deletes the pipeline; the applications are not removed and will remain in your Applications list. To completely remove an application, go to Settings > Danger Zone > Delete application. Deleting the application completely removes the following:

  • All files
  • Settings
  • Persistent storage disks
  • Connections to other applications or databases
Was this article helpful?