-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
62 lines (55 loc) · 1.49 KB
/
action.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: "Setup node and pnpm"
author: "Dafnik"
description: "Setup node, pnpm and the caching"
branding:
icon: 'arrow-down-circle'
color: 'purple'
inputs:
pnpm:
description: 'PNPM version'
required: false
default: 8
node:
description: "Node version"
required: false
default: 18
install:
description: "Runs pnpm install"
required: false
default: false
install-ignore-scripts:
description: "Runs pnpm install --ignore-scripts"
required: false
default: false
runs:
using: "composite"
steps:
- name: use pnpm ${{ inputs.pnpm }}
uses: pnpm/action-setup@v2
with:
version: ${{ inputs.pnpm }}
- name: use Node.js ${{ inputs.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node }}
cache: 'pnpm'
- name: get pnpm store directory
id: pnpm-dir
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: pnpm-cache
name: setup pnpm cache
with:
path: ${{ steps.pnpm-dir.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Run pnpm install
if: "${{ inputs.install }}"
shell: bash
run: pnpm install
- name: Run pnpm install --ignore-scripts
if: "${{ inputs.install-ignore-scripts }}"
shell: bash
run: pnpm install --ignore-scripts