Skip to content
GitHub Actions for DigitalOcean - doctl
Dockerfile Shell HCL
Branch: master
Clone or download
Latest commit 638bad8 Jul 19, 2019

GitHub Actions for DigitalOcean

This action enables you to interact with DigitalOcean services via the doctl command-line client.


As an example, one common use case is retrieving the credentials for a Kubernetes cluster hosted on DigitalOcean for use in a deployment workflow:

action "Save DigitalOcean kubeconfig" {
  needs = ["Push image to Docker Hub"]
  uses = "digitalocean/action-doctl@master"
  env = {
    CLUSTER_NAME = "example"
  args = ["kubernetes cluster kubeconfig show $CLUSTER_NAME > $HOME/.kubeconfig"]

See this repository for a full end-to-end example that also demonstrates building the Docker image, pushing it to Docker Hub, and using kubectl to deploy to the Kubernetes cluster on DigitalOcean.


  • DIGITALOCEAN_ACCESS_TOKENRequired A DigitalOcean personal access token (more info).

Environment variables

We provide defaults for the following, these may also be overridden:

  • DIGITALOCEAN_OUTPUT_FORMAT- Optional doctl's output output format, defaults to json

By default, this action is configured to save output in JSON format to ${HOME}/${GITHUB_ACTION}.${DIGITALOCEAN_OUTPUT_FORMAT}for consumption by downstream actions.


The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

You can’t perform that action at this time.