dagger-for-github icon indicating copy to clipboard operation
dagger-for-github copied to clipboard

Add cache option to Dagger action

Open TomChv opened this issue 3 years ago • 2 comments

When https://github.com/dagger/dagger/pull/1839 will be merged, we should update this action to supports cache option.

In a discussion with @aluzzardi, we talk about the following shape:

        name: Dagger
        uses: dagger/dagger-for-github@v2
        with:
          cache: true // New option
          cache-scope: example // Scope of the cache
          args: do test

That would add

  • cache: enable or disable GitHub cache for dagger | set to false by default?
  • cache-scope: explicit cache scope, useful to do not override existing cache from other action | set to dagger by default?

Question Should we also add mode option?

Useful links

TomChv avatar Mar 31 '22 17:03 TomChv

https://github.com/dagger/dagger/pull/1966 is merged.

fire avatar Sep 13 '22 00:09 fire

While this is being worked on you can use the --cache-{from,to} type=gha flags on the dagger do command as a work around.

This works because buildkit has GHA caching built-in (See TomChv's link in the first comment).

jobs:
  publish:
    name: "Dagger cache Demo"
    runs-on: ubuntu-latest
    steps:
      - name: "Dagger"
        uses: dagger/dagger-for-github@v3
        with:
          cmds: |
            project init
            project update
            do --cache-from type=gha --cache-to type=gha action

KGB33 avatar Oct 07 '22 17:10 KGB33

I suppose closed with regard to promote Dagger Cloud? 🤔

weilbith avatar Jul 04 '24 21:07 weilbith