Skip to main content

GitHub Actions

The following code sample demonstrates how to integrate Dagger with GitHub Actions.

.github/workflows/dagger.yml
name: dagger
on:
push:
branches: [main]

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
-
name: Call Dagger Function
uses: dagger/dagger-for-github@v5
with:
version: "0.10.2"
verb: call
# assumes a Go project
# modify to use different function(s) as needed
module: github.com/kpenfound/dagger-modules/golang@v0.1.5
args: build --project=. --args=.
# assumes the Dagger Cloud token is in
# a repository secret named DAGGER_CLOUD_TOKEN
# set via the GitHub UI/CLI
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}

More information is available in the Dagger for GitHub Action page.