Skip to content

Commit c4a09da

Browse files
committed
ci: update pnpm setup to use official action
1 parent d0813db commit c4a09da

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/actions/setup-pnpm/action.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,25 @@ runs:
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ inputs.node-version }}
26-
cache: 'pnpm'
26+
# cache: 'pnpm'
27+
# cache-dependency-path: '**/pnpm-lock.yaml'
2728

28-
- name: Install PNPM
29-
run: npm i pnpm@latest -g
30-
shell: bash
29+
- name: Install pnpm
30+
uses: pnpm/action-setup@v4
3131

32-
- name: Setup npmrc
33-
run: echo "//registry.npmjs.org/:_authToken=${{ inputs.npm-token }}" > .npmrc
32+
- name: Get pnpm store directory
3433
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
3536
36-
- name: Setup pnpm config
37-
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
38-
shell: bash
37+
- name: Setup pnpm cache
38+
uses: actions/cache@v4
39+
with:
40+
path: ${{ env.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
3944
40-
- name: Install Package
41-
run: pnpm install
45+
- name: Install dependencies
4246
shell: bash
47+
run: pnpm install

0 commit comments

Comments
 (0)