-
Notifications
You must be signed in to change notification settings - Fork 171
38 lines (36 loc) · 1.49 KB
/
cache-pnpm-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Cache PNPM Install
on:
workflow_call:
outputs:
pnpm-store-path:
value: ${{ jobs.cache-pnpm-store.outputs.pnpm-store-path }}
jobs:
cache-pnpm-store:
name: Install everything with PNPM and cache it
timeout-minutes: 15
runs-on: ubuntu-latest
env:
UTOPIA_SHA: ${{ github.sha }}
outputs:
pnpm-store-path: ${{ steps.capture-pnpm-store-path.outputs.pnpm-store-path }}
steps:
- name: Cancel existing runs on this branch
uses: fauguste/auto-cancellation-running-action@0.1.4
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check out the repo
uses: actions/checkout@v2
- name: Install nix
uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/6120ac5cd201f6cb593d1b80e861be0342495be9.tar.gz
- name: Capture pnpm store path
id: capture-pnpm-store-path
run: nix-shell --arg includeServerBuildSupport false --arg includeRunLocallySupport false --run 'echo "pnpm-store-path=$(pnpm store path)" >> "$GITHUB_OUTPUT"'
- name: Cache pnpm store
uses: actions/cache@v2
with:
path: ${{ steps.capture-pnpm-store-path.outputs.pnpm-store-path }}
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-captured-location
- name: Run the install steps
run: nix-shell --arg includeServerBuildSupport false --arg includeRunLocallySupport false --run install-website-editor-ci