Deploy to DigitalOcean

How to deploy to DigitalOcean with Buddy?

Deploying to DigitalOcean with Buddy is a game-changer for managing your server updates. With Buddy, you can automate your deployments, ensuring your servers are updated with every code change. In this article, we'll show you how to set up and configure a pipeline to make the deployment process easier.

Image loading...Example pipeline with deployment to a DigitalOcean dropletExample pipeline with deployment to a DigitalOcean droplet

Tip
If you are new to Buddy, check out our quickstart guides that will tell you how to build and test your application before the deployment.

Configure pipeline in Buddy

To automate DigitalOcean deployments with Buddy pipelines, you need to:

  1. Create a new project in Buddy and select your Git provider:

Image loading...Git provider selection when creating new projectGit provider selection when creating new project

  1. Add a new pipeline and configure the details: name, trigger mode, and branch from which you want to deploy.

Image loading...Adding new pipelineAdding new pipeline

Configure DigitalOcean Droplet deployment in Buddy

  1. Look up DigitalOcean and click Droplet on the action list to add it to the pipeline:

Image loading...DigitalOcean actionsDigitalOcean actions

  1. The action has five configuration tabs:
  • Transfer – here you define the source path, select the droplet, and set deployment flags
  • Target – here you select the DigitalOcean integration and define what and where should be deployed
  • Variables – here you can add and configure environment variables required by your workflow
  • Conditions – here you configure the trigger conditions for which the action will run
  • Options – here you define the action's name and behavior on failure and timeout
Warning
If you are using build actions in your pipeline, make sure to select the Filesystem as the source to deploy artifacts and processed files.

Image loading...DigitalOcean configurationDigitalOcean configuration

Hint
Buddy's deployment is based on changesets. This means only changed files are deployed, which makes it lightning fast ⚡️. The first deployment is always performed from scratch, unless you set a revision on the server in the Options tab.
  1. When ready, click Add this action to finish configuration.

Congratulations! Your application is now ready to auto deploy, allowing you to focus on other important tasks. You can also expand your pipeline with the DigitalOcean CLI action, which allows you not only to manage droplets but also automate backups and snapshots, manage networks and dynamically scale your infrastructure. You can, for example, create a pipeline that will launch a new droplet, deploy an application on it, run tests, and delete the droplet at the end. All of this can be done without the need for manual configuration in the DigitalOcean panel. This is a perfect solution for those who value automation and full control over complex production environments.

Hint

đź“š Learn more about DigitalOcean Droplet action features, integrations and alternatives.

Last update:
Sep 25, 2024