-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathaction.yml
More file actions
43 lines (37 loc) · 1.35 KB
/
action.yml
File metadata and controls
43 lines (37 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Setup Node and pnpm
runs:
using: composite
steps:
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false
# see pnpm cache setting below
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Get pnpm store directory
id: store
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Save and restore pnpm cache on main
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
if: ${{ github.ref_name == 'main' }}
with:
path: ${{ steps.store.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Restore pnpm cache on PR
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
if: ${{ github.ref_name != 'main' }}
with:
path: ${{ steps.store.outputs.STORE_PATH }}
key: |
${{ runner.os }}-pnpm-store-
- run: pnpm install --frozen-lockfile --ignore-scripts
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}