Skip to content

Commit 430f534

Browse files
Update call-reusable.yml
1 parent d052241 commit 430f534

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

.github/workflows/call-reusable.yml

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1-
name: PNPM Cache Workflow
1+
name: PNPM Cache Example
22

33
on:
44
workflow_call:
5-
65

76
jobs:
8-
pnpm-cache-job:
9-
runs-on: self-hosted
7+
install:
8+
runs-on: ubuntu-latest
109

1110
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
11+
- uses: actions/checkout@v4
12+
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 18.20.4
17+
cache: 'pnpm'
18+
19+
- name: Install PNPM
20+
run: npm install -g pnpm
21+
22+
- name: Show PNPM store path
23+
id: pnpm-cache-path
24+
run: echo "STORE_PATH=$(pnpm store path)" >> $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
34+
35+
- name: Save PNPM cache
36+
uses: actions/cache@v4
37+
with:
38+
path: ${{ env.STORE_PATH }}
39+
key: pnpm-store-${{ runner.os }}-18.20.4-v1

0 commit comments

Comments
 (0)