From 1a59d22139a6bebf1ac011b92bc4219272ad634a Mon Sep 17 00:00:00 2001 From: TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> Date: Tue, 25 May 2021 13:26:02 -0600 Subject: add caching to workflow --- .github/workflows/nodejs.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index ff4aa95..7fc5058 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -18,6 +18,16 @@ jobs: uses: actions/setup-node@v1 with: node-version: 14.x + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install dependencies run: yarn - name: Fix config @@ -40,6 +50,16 @@ jobs: uses: actions/setup-node@v1 with: node-version: 14.x + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn config get cacheFolder)" + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- - name: Install dependencies run: yarn - name: Configure git -- cgit