dagger-for-github
dagger-for-github copied to clipboard
Add cache option to Dagger action
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 tofalseby default?cache-scope: explicit cache scope, useful to do not override existing cache from other action | set todaggerby default?
Question
Should we also add mode option?
Useful links
https://github.com/dagger/dagger/pull/1966 is merged.
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
I suppose closed with regard to promote Dagger Cloud? 🤔