We use cookies to understand how people use Depot.
GitHub Actions

Dagger

Connect with Dagger Cloud and run your Dagger Engine builds on Depot's Ultra Runners for GitHub Actions with our accelerated cache enabled.

Authentication

Accessing Dagger Engines in Depot requires that you connect Depot to your Dagger Cloud account and access the Engine via Depot GitHub Actions Runners.

Connect to Dagger Cloud

From the Dagger Cloud UI, generate a Dagger Cloud token and copy it to your clipboard.

From your Depot Dashboard, you will see "Dagger" listed in the left-hand navigation under "CI Runners". Click on "Dagger" and in the top right corner you will see the "Add Token" button. Add your token, and you should see a message that you have successfully connected.

Connect to GitHub

Finally, ensure you are connected to GitHub. Under the "CI Runners" section, click on "GitHub Actions" and connect your GitHub account. You will be prompted to connect with your GitHub organization and specify all or specific repositories to enable access to Depot Runners.

Configuration

In your GitHub Actions workflow, you can specify both the Depot Runner label and the Dagger Engine version directly in the runs-on key using a comma-separated format. <depot-runner-label>,dagger=<dagger-version>.

name: dagger
on: push

jobs:
  build:
    runs-on: depot-ubuntu-latest,dagger=0.18.4
  steps:
    - uses: actions/checkout@v4
    - run: dagger -m github.com/kpenfound/dagger-modules/golang@v0.2.0 call \
        build --source=https://github.com/dagger/dagger --args=./cmd/dagger \
        export --path=./build

You can locate the latest Dagger Engine release version and all potentially breaking changes in the Dagger Engine Changelog.

The Dagger CLI will be available and pre-authenticated with your Dagger Cloud token. Once a Dagger request is made, Depot initializes a new Dagger project for that repository without additional configuration.

With these steps, your workflow is now ready to run on Depot’s accelerated infrastructure using Dagger and GitHub Actions.

How does it work?

Using Dagger engines via Depot GitHub Actions Runners allows you to execute your Dagger pipelines and functions inside of a dedicated VM with a persistent NVMe device for cache storage that lives next to the GitHub Actions runners without having to do any additional configuration outside of the above.

Architecture

Depot GitHub Actions Runners with Dagger architecture

The general architecture allows for fast persistent cache for your Dagger projects automatically across builds. Here is the flow of information and what happens at each step when you specify runs-on: depot-ubuntu-latest,dagger=<version> in your GitHub Actions workflow:

  1. The Depot control plane receives the request for your GitHub Actions job and takes note of your request for a Dagger engine as well. We launch the Dagger Engine VM at the specified version next to your GitHub Actions runner, attaching your cache volume from previous builds to that VM. We then tell the GitHub Actions runner to pre-configure the GitHub Actions environment, installing the specific dagger CLI version for you and point it at the Dagger Engine running next door, and automatically authenticate to your Dagger Cloud account for logs and telemetry.
  2. The GitHub Actions runner starts up and runs the job, which includes the Dagger CLI. The Dagger CLI is pre-configured to use the Dagger Engine running next door, the dagger step is thus kicked off on the separate Dagger Engine VM with it's persistent cache. The Dagger execution runs to completion and logs + telemetry are shipped to your Dagger Cloud account.
  3. The Dagger Engine VM is automatically shut down after the job completes, and the cache volume is detached from the VM and returned to Depot's control plane for future use.
  4. The GitHub Actions runner completes the job and returns the results to GitHub.

Pricing

Dagger engines accessed via our GitHub Actions Runners are charged by the build minute at $0.04/minute, in addition to the GitHub Actions Runner build time.