Best implementation to cache pnpm deps in github action #8829
-
|
When using mise, we can use it for What's the best course of action? I can always implement my own actions/cache but i wonder if there's something more clever that i don't know about. How other did it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
I usually just stick with The cleanest way is to let mise initialize your tools, then grab the store path dynamically so the cache stays isolated to the specific environment mise creates: - uses: jdx/mise-action@v2
- name: Get pnpm store path
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-This avoids any weirdness with |
Beta Was this translation helpful? Give feedback.
I usually just stick with
actions/cachefor the pnpm store path. Sincejdx/mise-actionis really intended to cache the mise binaries/tools themselves, trying to shove app-level dependencies in there is usually a headache.The cleanest way is to let mise initialize your tools, then grab the store path dynamically so the cache stays isolated to the specific environment mise creates: