-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Amin Yahyaabadi <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ jobs: | |
key: cache-${{ hashFiles('.github/workflows/test/Dockerfile') }} | ||
|
||
- name: inject cache into docker | ||
uses: reproducible-containers/buildkit-cache-dance@v3.0.0 | ||
uses: reproducible-containers/buildkit-cache-dance@v3.1.0 | ||
with: | ||
cache-map: | | ||
{ | ||
|
@@ -89,34 +89,39 @@ Real-world examples: | |
|
||
Optionally, instead of a single string for the `target`, you can provide an object with additional options that should be passed to `--mount=type=cache` in the values `cache-map` JSON. The `target` path must be present in the object as a property. | ||
|
||
```json | ||
{ | ||
"var-cache-apt": { | ||
"target": "/var/cache/apt", | ||
"id": "1" | ||
}, | ||
"var-lib-apt": "/var/lib/apt" | ||
} | ||
```yaml | ||
- name: inject cache into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-map: | | ||
{ | ||
"var-cache-apt": { | ||
"target": "/var/cache/apt", | ||
"id": "1" | ||
}, | ||
"var-lib-apt": "/var/lib/apt" | ||
} | ||
skip-extraction: ${{ steps.cache.outputs.cache-hit }} | ||
``` | ||
## CLI Usage | ||
In other CI systems, you can run the script directly via `node`: | ||
|
||
```shell | ||
curl -LJO https://github.com/reproducible-containers/buildkit-cache-dance/archive/refs/tags/v3.0.0.tar.gz | ||
tar xvf buildkit-cache-dance-3.0.0.tar.gz | ||
curl -LJO https://github.com/reproducible-containers/buildkit-cache-dance/archive/refs/tags/v3.1.0.tar.gz | ||
tar xvf buildkit-cache-dance-3.1.0.tar.gz | ||
``` | ||
During injection: | ||
|
||
```shell | ||
node ./buildkit-cache-dance-3.0.0/dist/index.js --cache-map '{"var-cache-apt": "/var/cache/apt", "var-lib-apt": "/var/lib/apt"}' | ||
node ./buildkit-cache-dance-3.1.0/dist/index.js --cache-map '{"var-cache-apt": "/var/cache/apt", "var-lib-apt": "/var/lib/apt"}' | ||
``` | ||
|
||
After build during extraction: | ||
|
||
```shell | ||
node ./buildkit-cache-dance-3.0.0/dist/index.js --extract --cache-map '{"var-cache-apt": "/var/cache/apt", "var-lib-apt": "/var/lib/apt"}' | ||
node ./buildkit-cache-dance-3.1.0/dist/index.js --extract --cache-map '{"var-cache-apt": "/var/cache/apt", "var-lib-apt": "/var/lib/apt"}' | ||
``` | ||
|
||
Here are the available options: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters