From 1704e3a8b52b01cf5e71b2d4bdf286666eb5d0f4 Mon Sep 17 00:00:00 2001 From: Jaemin Choi <1dotolee@gmail.com> Date: Sat, 26 Jun 2021 11:15:38 +0000 Subject: [PATCH] Cache yarn packages in GitHub Actions --- .github/workflows/test-frontend.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index 48e49ff9b..93bb97ae8 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -19,15 +19,32 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 with: node-version: '14' + - name: Get yarn cache directory path + id: yarn-cache-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Cache Node modules + id: cache-yarn + uses: actions/cache@v2 + with: + path: | + ${{ steps.yarn-cache-path.outputs.dir }} + ./frontend/public + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}- + - name: Install Node packages working-directory: ${{ env.working-directory }} run: yarn install - name: Pre-build with Dll-Plugin + if: steps.cache-yarn.outputs.cache-hit != 'true' working-directory: ${{ env.working-directory }} run: yarn dll