Skip to content

Commit

Permalink
Add docs for cache-write (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw authored Nov 16, 2023
1 parent 4bb84de commit 2023b09
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Assert latest setup-pixi version is mentioned in README
run: |
latest_version="$(jq -r '.version' package.json)"
count_expected=9
count_expected=10
count_actual="$(grep -c "setup-pixi@v$latest_version" README.md || true)"
if [ "$count_actual" -ne "$count_expected" ]; then
echo "::error file=README.md::Expected $count_expected mentions of setup-pixi@v$latest_version in README.md, but found $count_actual."
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GitHub Action to set up the [pixi](https://github.com/prefix-dev/pixi) package m
```yml
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.5.0
pixi-version: v0.7.0
cache: true
auth-host: prefix.dev
auth-token: ${{ secrets.PREFIX_DEV_TOKEN }}
Expand All @@ -52,6 +52,18 @@ You can specify the behavior by setting the `cache` input argument.
If you need to customize your cache-key, you can use the `cache-key` input argument.
This will be the prefix of the cache key. The full cache key will be `<cache-key><conda-arch>-<hash>`.

#### Only save caches on `main`

In order to not exceed the [10 GB cache size limit](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy) as fast, you might want to restrict when the cache is saved.
This can be done by setting the `cache-write` argument.

```yml
- uses: prefix-dev/[email protected]
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
```

### Authentication

There are currently three ways to authenticate with pixi:
Expand Down

0 comments on commit 2023b09

Please sign in to comment.