Keycloak
48 строк · 1.3 Кб
1name: Setup PNPM
2description: Sets up Node.js and runs PNPM so dependencies are installed.
3
4inputs:
5node-version:
6description: Node.js version
7required: false
8default: "18"
9
10working-directory:
11description: The working directory where the `pnpm-lock.yaml` file is located.
12required: false
13default: ""
14
15runs:
16using: composite
17steps:
18- name: Set up Node.js
19uses: actions/setup-node@v3
20with:
21node-version: ${{ inputs.node-version }}
22check-latest: true
23
24- name: Enable Corepack
25shell: bash
26run: corepack enable
27
28- name: Get PNPM store directory
29id: pnpm-cache
30shell: bash
31run: |
32echo "store-path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
33
34- uses: actions/cache@v3
35name: Setup PNPM cache
36with:
37# Also cache Cypress binary.
38path: |
39~/.cache/Cypress
40${{ steps.pnpm-cache.outputs.store-path }}
41key: ${{ runner.os }}-pnpm-store-${{ hashFiles('${{ inputs.working-directory }}/pnpm-lock.yaml') }}
42restore-keys: |
43${{ runner.os }}-pnpm-store-
44
45- name: Install dependencies
46working-directory: ${{ inputs.working-directory }}
47shell: bash
48run: pnpm install --prefer-offline --frozen-lockfile
49