From b26427e53eeeb8730a03e344c65c6600352c13c2 Mon Sep 17 00:00:00 2001 From: Joe Hildebrand Date: Mon, 15 Feb 2021 14:36:25 -0700 Subject: [PATCH] Adds documentation hints for caching. Fixes #8. --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 1ae9812..9b445b2 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,40 @@ jobs: - args: [--global, gulp, prettier, typescript] ``` +### Cache + +To speed up install times + +```yaml +on: + - push + - pull_request + +jobs: + runs-on: ubuntu-latest + + steps: + build: + - uses: actions/checkout@v2 + + - name: Cache pnpm modules + uses: actions/cache@v2 + env: + cache-name: cache-pnpm-modules + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- + + - uses: pnpm/action-setup@v1.2.1 + with: + version: 5.17.2 + run_install: true +``` + +You don't need to run `pnpm store prune` at the end; this package will take care of that for you. + ## Notes This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.