Deploy to DigitalOcean Spaces

How to deploy to DigitalOcean Spaces?

To start deploying to DigitalOcean Spaces, configure a pipeline in Buddy and create Spaces Object Storage, where your assets will be automatically updated. You can also configure the pipeline to run only on click, or recurrently.

Example pipeline with DigitalOcean Spaces deployment for database backupExample pipeline with DigitalOcean Spaces deployment for database backup

Configure pipeline in Buddy

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

Creating new projectCreating new project

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

Adding new pipelineAdding new pipeline

Tip
If you are new to Buddy, check out our quickstart guides that will tell you how to create build, test and deploy your type of application.

Create Spaces Object Storage

DigitalOcean Spaces Object Storage is a scalable and secure service for storing data in the cloud. It allows you to store and manage large amounts of unstructured data in containers called "buckets". To create a bucket:

  1. Go to Spaces Object Storage in the DigitalOcean panel.
  2. Click Create spaces Bucket:

  1. Provide a name for your bucket, select a datacenter region, a project and decide whether to enable CDN:

Creating Spaces BucketCreating Spaces Bucket

By default, your bucket does not have public access, it is only accessible to the specific team assigned to the account.

Once the Spaces Bucket is configured, you can add and configure the deployment action.

Configure DigitalOcean Spaces deployment

  1. Look up DigitalOcean Spaces on the action list to add it to the pipeline:

DigitalOcean actionsDigitalOcean actions

  1. The action has four configuration tabs:
  • Transfer – here you define the source path, deployment flags, file encoding, and cache settings
  • Target – here you select the DigitalOcean Spaces integration and define region, bucket ID, and bucket path
  • Variables – here you can add and modify 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

DigitalOcean Spaces action configurationDigitalOcean Spaces action 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.

  2. (Optional) You can also add the DigitalOcean Spaces CDN action at the end of the pipeline to automatically purge the cache in selected Spaces bucket after the deployment.

Warning
To add the Spaces CDN action, the integration with DO Spaces is not enough. You also need to add the DigitalOcean integration.

DigitalOcean Spaces CDN configurationDigitalOcean Spaces CDN configuration

Congratulations! You have just automated your deployment to DigitalOcean Spaces and you can enjoy the benefits that Buddy provides to your workflow 🥳

Hint

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

Last update:
Sep 17, 2024