feat: add built-in caching via inputs (#89)

This commit is contained in:
Christian Svensson
2025-05-12 18:53:44 +02:00
committed by GitHub
parent a1496dd8d9
commit fd6b0ad149
14 changed files with 63237 additions and 19455 deletions

View File

@@ -141,3 +141,23 @@ number.
- run: echo "Deno version is ${{ steps.deno.outputs.deno-version }}"
```
### Caching dependencies downloaded by Deno automatically
Dependencies installed by Deno can be cached automatically, which is similar to
the [`cache` option in `setup-node`](https://github.com/actions/setup-node).
To enable the cache, use `cache: true`. It's recommended to also add the
`cache-hash` property, to scope caches based on lockfile changes.
```yaml
- uses: denoland/setup-deno@v2
with:
cache: true
cache-hash: ${{ hashFiles('**/deno.lock') }}
```
> [!WARNING]
> If an environment variable `DENO_DIR` is set for steps that run/download
> dependencies, then `DENO_DIR` must also be set for the `denoland/setup-deno`
> action, for the caching to work as intended.