Skip to content

Commit c4ee502

Browse files
authored
👷 cache (#9)
1 parent 4a77635 commit c4ee502

File tree

4 files changed

+52
-6
lines changed

4 files changed

+52
-6
lines changed

.github/workflows/ci.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,23 @@ jobs:
2323
uses: actions/setup-node@v1
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
- name: Install pnpm
27-
run: npm i [email protected] -g
26+
- uses: pnpm/action-setup@v2
27+
name: Install pnpm
28+
id: pnpm-install
29+
with:
30+
run_install: false
31+
- name: get pnpm store directory
32+
id: pnpm-cache
33+
shell: bash
34+
run: |
35+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
36+
- uses: actions/cache@v3
37+
name: setup pnpm cache
38+
with:
39+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
40+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+
restore-keys: |
42+
${{ runner.os }}-pnpm-store-
2843
- name: Install
2944
run: |
3045
pnpm install --frozen-lockfile=false

.github/workflows/release.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,23 @@ jobs:
2424
uses: actions/setup-node@v2
2525
with:
2626
node-version: 16
27-
- name: install pnpm
28-
run: npm i [email protected] -g
27+
- uses: pnpm/action-setup@v2
28+
name: Install pnpm
29+
id: pnpm-install
30+
with:
31+
run_install: false
32+
- name: get pnpm store directory
33+
id: pnpm-cache
34+
shell: bash
35+
run: |
36+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
37+
- uses: actions/cache@v3
38+
name: setup pnpm cache
39+
with:
40+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
restore-keys: |
43+
${{ runner.os }}-pnpm-store-
2944
- name: install dependencies
3045
run: pnpm install --frozen-lockfile=false
3146
- name: create and publish versions

.github/workflows/snapshot-release.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,23 @@ jobs:
2222
uses: actions/setup-node@v2
2323
with:
2424
node-version: 16
25-
- name: install pnpm
26-
run: npm i [email protected] -g
25+
- uses: pnpm/action-setup@v2
26+
name: Install pnpm
27+
id: pnpm-install
28+
with:
29+
run_install: false
30+
- name: get pnpm store directory
31+
id: pnpm-cache
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
35+
- uses: actions/cache@v3
36+
name: setup pnpm cache
37+
with:
38+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
39+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
restore-keys: |
41+
${{ runner.os }}-pnpm-store-
2742
- name: install dependencies
2843
run: pnpm install --frozen-lockfile=false
2944
- name: create and publish versions

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "vsit-monorepo",
33
"version": "0.0.0",
44
"private": true,
5+
"packageManager": "[email protected]",
56
"description": "vsit monorepo",
67
"keywords": ["vsit"],
78
"license": "MIT",

0 commit comments

Comments
 (0)