Skip to content

Commit 33ae9af

Browse files
committed
docs: adding readme entry for custom cache
1 parent 00d3eda commit 33ae9af

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,28 @@ steps:
381381
run: flutter build apk
382382
```
383383

384+
### Using custom cache actions
385+
386+
If you'd like to use a caching action other than `actions/cache` (the GitHub default), you can provide custom actions like this:
387+
388+
```yaml
389+
- name: Configure Flutter
390+
id: config-flutter
391+
uses: subosito/flutter-action@v2
392+
with:
393+
channel: stable
394+
cache: true
395+
custom-pub-cache-action: my-organization/actions/repository-scoped-cache@main
396+
custom-cache-action: my-organization/actions/global-cache@main
397+
```
398+
399+
Both custom actions must be drop-in replacements for `actions/cache`: they should accept the same inputs and expose the same outputs.
400+
401+
Notes:
402+
403+
- **custom-pub-cache-action** — Recommended to use a repository-scoped cache action (or narrower) as the cache key incorporates a hash of your project's `pubspec.yaml` files. The default `actions/cache` is repository-scoped and also branch-scoped.
404+
- **custom-cache-action** — Recommended to use a global-scoped cache action here to increase hit rates across multiple Flutter repositories that use the same Flutter version.
405+
384406
## Outputs
385407

386408
Use outputs from `flutter-action`:

0 commit comments

Comments
 (0)