Skip to content

Commit

Permalink
feat: pnpm-setup workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Guz013 committed Jun 27, 2023
1 parent 4d7c9d6 commit 6e6c3e9
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/pnpm-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "PNPM Setup"

on:
workflow_call:
inputs:
node-version:
required: false
type: number
default: 18
pnpm-version:
required: false
type: number
default: 8
install-deps:
required: false
type: boolean
default: true

jobs:
cache-and-install:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}

- name: Install PNPM
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: ${{ inputs.pnpm-version }}
run_install: false

- name: Get store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys:
${{ runner.os }}-pnpm-store-

- name: Install dependencies
if: inputs.install-deps
run: pnpm install

0 comments on commit 6e6c3e9

Please sign in to comment.