|
87 | 87 | {{< summary-bar feature_name="Cache backend API" >}}
|
88 | 88 |
|
89 | 89 | The [GitHub Actions cache exporter](../../cache/backends/gha.md)
|
90 |
| -backend uses the [GitHub Cache API](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md) |
| 90 | +backend uses the [GitHub Cache service API](https://github.com/tonistiigi/go-actions-cache) |
91 | 91 | to fetch and upload cache blobs. That's why you should only use this cache
|
92 |
| -backend in a GitHub Action workflow, as the `url` (`$ACTIONS_CACHE_URL`) and |
| 92 | +backend in a GitHub Action workflow, as the `url` (`$ACTIONS_RESULTS_URL`) and |
93 | 93 | `token` (`$ACTIONS_RUNTIME_TOKEN`) attributes only get populated in a workflow
|
94 | 94 | context.
|
95 | 95 |
|
@@ -121,6 +121,64 @@ jobs:
|
121 | 121 | cache-to: type=gha,mode=max
|
122 | 122 | ```
|
123 | 123 |
|
| 124 | +> [!IMPORTANT] |
| 125 | +> |
| 126 | +> Starting [April 15th, 2025, only GitHub Cache service API v2 will be supported](https://gh.io/gha-cache-sunset). |
| 127 | +> |
| 128 | +> If you encounter the following error during your build: |
| 129 | +> |
| 130 | +> ```console |
| 131 | +> ERROR: failed to solve: This legacy service is shutting down, effective April 15, 2025. Migrate to the new service ASAP. For more information: https://gh.io/gha-cache-sunset |
| 132 | +> ``` |
| 133 | +> |
| 134 | +> You're probably using outdated tools that only support the legacy GitHub |
| 135 | +> Cache service API v1. Here are the minimum versions you need to upgrade to |
| 136 | +> depending on your use case: |
| 137 | +> * Docker Buildx >= v0.21.0 |
| 138 | +> * BuildKit >= v0.20.0 |
| 139 | +> * Docker Compose >= v2.33.1 |
| 140 | +> * Docker Engine >= v28.0.0 (if you're building using the Docker driver with containerd image store enabled) |
| 141 | +> |
| 142 | +> If you're building using the `docker/build-push-action` or `docker/bake-action` |
| 143 | +> actions on GitHub hosted runners, Docker Buildx and BuildKit are already up |
| 144 | +> to date but on self-hosted runners, you may need to update them yourself. |
| 145 | +> Alternatively, you can use the `docker/setup-buildx-action` action to install |
| 146 | +> the latest version of Docker Buildx: |
| 147 | +> |
| 148 | +> ```yaml |
| 149 | +> - name: Set up Docker Buildx |
| 150 | +> uses: docker/setup-buildx-action@v3 |
| 151 | +> with: |
| 152 | +> version: latest |
| 153 | +> ``` |
| 154 | +> |
| 155 | +> If you're building using Docker Compose, you can use the |
| 156 | +> `docker/setup-compose-action` action: |
| 157 | +> |
| 158 | +> ```yaml |
| 159 | +> - name: Set up Docker Compose |
| 160 | +> uses: docker/setup-compose-action@v1 |
| 161 | +> with: |
| 162 | +> version: latest |
| 163 | +> ``` |
| 164 | +> |
| 165 | +> If you're building using the Docker Engine with the containerd image store |
| 166 | +> enabled, you can use the `docker/setup-docker-action` action: |
| 167 | +> |
| 168 | +> ```yaml |
| 169 | +> - |
| 170 | +> name: Set up Docker |
| 171 | +> uses: docker/setup-docker-action@v4 |
| 172 | +> with: |
| 173 | +> version: latest |
| 174 | +> daemon-config: | |
| 175 | +> { |
| 176 | +> "features": { |
| 177 | +> "containerd-snapshotter": true |
| 178 | +> } |
| 179 | +> } |
| 180 | +> ``` |
| 181 | + |
124 | 182 | ### Cache mounts
|
125 | 183 |
|
126 | 184 | BuildKit doesn't preserve cache mounts in the GitHub Actions cache by default.
|
|
0 commit comments