Skip to content

Commit 5d28e19

Browse files
Build: GHA cache (#23365)
<!--Delete sections as needed --> ## Description adds https://github.com/docker/buildx/pull/2983/files/7ba4da08000f8909b5fb1fe76fd88f34357a21f6#r2102395629 ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [ ] Editorial review - [ ] Product review --------- Co-authored-by: CrazyMax <[email protected]>
1 parent 2a483c2 commit 5d28e19

File tree

1 file changed

+12
-1
lines changed
  • content/manuals/build/cache/backends

1 file changed

+12
-1
lines changed

content/manuals/build/cache/backends/gha.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following table describes the available CSV parameters that you can pass to
3232

3333
| Name | Option | Type | Default | Description |
3434
|----------------|-------------------------|-------------|------------------------------------------------|----------------------------------------------------------------------|
35-
| `url` | `cache-to`,`cache-from` | String | `$ACTIONS_CACHE_URL` or `$ACTIONS_RESULTS_URL` | Cache server URL, see [authentication][1]. |
35+
| `url` | `cache-to`,`cache-from` | String | `$ACTIONS_CACHE_URL` or `$ACTIONS_RESULTS_URL` | Cache server URL, see [authentication][1]. Ignored when `version=2`. |
3636
| `url_v2` | `cache-to`,`cache-from` | String | `$ACTIONS_RESULTS_URL` | Cache v2 server URL, see [authentication][1]. |
3737
| `token` | `cache-to`,`cache-from` | String | `$ACTIONS_RUNTIME_TOKEN` | Access token, see [authentication][1]. |
3838
| `scope` | `cache-to`,`cache-from` | String | `buildkit` | Which scope cache object belongs to, see [scope][2] |
@@ -41,10 +41,12 @@ The following table describes the available CSV parameters that you can pass to
4141
| `timeout` | `cache-to`,`cache-from` | String | `10m` | Max duration for importing or exporting cache before it's timed out. |
4242
| `repository` | `cache-to` | String | | GitHub repository used for cache storage. |
4343
| `ghtoken` | `cache-to` | String | | GitHub token required for accessing the GitHub API. |
44+
| `version` | `cache-to`,`cache-from` | String | `1` unless `$ACTIONS_CACHE_SERVICE_V2` is set, then `2` | Selects GitHub Actions cache version, see [version][4] |
4445

4546
[1]: #authentication
4647
[2]: #scope
4748
[3]: _index.md#cache-mode
49+
[4]: #version
4850

4951
## Authentication
5052

@@ -78,6 +80,15 @@ GitHub's [cache access restrictions](https://docs.github.com/en/actions/advanced
7880
still apply. Only the cache for the current branch, the base branch and the
7981
default branch is accessible by a workflow.
8082

83+
## Version
84+
85+
If you don’t set `version` explicitly, the default is v1. However, if the environment variable `$ACTIONS_CACHE_SERVICE_V2` is set to a value interpreted as `true` ( `1`, `true`, `yes`), then v2 is used automatically.
86+
87+
Only one URL is relevant at a time:
88+
89+
- With v1, use `url` (defaults to `$ACTIONS_CACHE_URL`).
90+
- With v2, use `url_v2` (defaults to `$ACTIONS_RESULTS_URL`).
91+
8192
### Using `docker/build-push-action`
8293

8394
When using the

0 commit comments

Comments
 (0)