Skip to content

Commit 8e9afc4

Browse files
Create call-reusable.yml
1 parent add52ce commit 8e9afc4

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/call-reusable.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: PNPM Cache Workflow
2+
3+
on:
4+
workflow_call:
5+
6+
7+
jobs:
8+
pnpm-cache-job:
9+
runs-on: self-hosted
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 18.20.4
19+
cache: 'pnpm'
20+
21+
- name: Get PNPM store path
22+
id: pnpm-store
23+
run: |
24+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
25+
26+
- name: Restore PNPM cache
27+
uses: actions/cache@v4
28+
with:
29+
path: ${{ env.STORE_PATH }}
30+
key: pnpm-store-${{ runner.os }}-18.20.4-v1
31+
32+
- name: Install dependencies
33+
run: pnpm install --no-strict-peer-dependencies --ignore-script
34+
35+
- name: Save PNPM cache
36+
uses: actions/cache/save@v4
37+
if: always()
38+
with:
39+
path: ${{ env.STORE_PATH }}
40+
key: pnpm-store-${{ runner.os }}-18.20.4-v1

0 commit comments

Comments
 (0)