dagger / dagger-for-github

GitHub Action for Dagger
https://github.com/marketplace/actions/dagger-for-github
Apache License 2.0
124 stars 26 forks source link

Add cache option to Dagger action #39

Closed TomChv closed 1 year ago

TomChv commented 2 years ago

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

Question Should we also add mode option?

Useful links

fire commented 2 years ago

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

KGB33 commented 1 year ago

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
weilbith commented 2 months ago

I suppose closed with regard to promote Dagger Cloud? 🤔