Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: update the version to v3.1.0
Signed-off-by: Amin Yahyaabadi <[email protected]>
  • Loading branch information
aminya committed Apr 2, 2024
commit cfc6f5e65bff1f25e77cf83a0fbfa218aa7550f9
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
{
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "buildkit-cache-dance",
"version": "3.0.0",
"description": "",
"version": "3.1.0",
"description": "Save `RUN --mount=type=cache` caches on GitHub Actions or other CI platforms",
"main": "dist/index.js",
"source": "src/index.ts",
"type": "module",
Expand Down