Skip to content

Commit bc797fb

Browse files
committed
docs: adding readme entry for custom cache
1 parent e3257ce commit bc797fb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,28 @@ steps:
370370
run: flutter build apk
371371
```
372372
373+
### Using custom cache actions
374+
375+
If you'd like to use a caching action other than `actions/cache` (the GitHub default), you can provide custom actions like this:
376+
377+
```yaml
378+
- name: Configure Flutter
379+
id: config-flutter
380+
uses: subosito/flutter-action@v2
381+
with:
382+
channel: stable
383+
cache: true
384+
custom-pub-cache-action: my-organization/actions/repository-scoped-cache@main
385+
custom-cache-action: my-organization/actions/global-cache@main
386+
```
387+
388+
Both custom actions must be drop-in replacements for `actions/cache`: they should accept the same inputs and expose the same outputs.
389+
390+
Notes:
391+
392+
- **custom-pub-cache-action** — Recommended to use a repository-scoped cache action (or narrower) so the cache key can incorporate your project's `pubspec.yaml` files. The default `actions/cache` is repository-scoped and also branch-scoped.
393+
- **custom-cache-action** — YRecommended to use a global-scoped cache action here to increase hit rates across multiple Flutter repositories that use the same Flutter version.
394+
373395
## Outputs
374396

375397
Use outputs from `flutter-action`:

0 commit comments

Comments
 (0)