From 40c7c3bba8e7547a243854430c78cc014f53e3aa Mon Sep 17 00:00:00 2001 From: BostonRohan Date: Sat, 6 Apr 2024 16:42:55 -0400 Subject: [PATCH] fix: setup pnpm --- .github/workflows/production.yml | 19 ++++++++++++++++++- .github/workflows/staging.yml | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 3e35f35..8b61c11 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -10,11 +10,28 @@ jobs: deploy: runs-on: ubuntu-latest environment: production - steps: - name: 🏪 Checkout repo uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + name: 🏠 Setup pnpm + with: + run_install: false + + - name: 📁 Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: 👷‍♂️ Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: 🖥️ Install dependencies run: pnpm install diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 0f285f5..f97cd64 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -10,11 +10,28 @@ jobs: deploy: runs-on: ubuntu-latest environment: preview - steps: - name: 🏪 Checkout repo uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + name: 🏠 Setup pnpm + with: + run_install: false + + - name: 📁 Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: 👷‍♂️ Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: 🖥️ Install dependencies run: pnpm install