From cfaa81c1dd2b1c9fcf5d24a83a1647ad51b95b07 Mon Sep 17 00:00:00 2001 From: moreal Date: Thu, 24 Oct 2024 21:19:55 +0900 Subject: [PATCH] Enable yarn cache --- .github/workflows/build.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4f26747..921b6d2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,6 +15,20 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + + - run: corepack enable + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v4 + 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-${{ hashFiles('**/yarn.lock') }} - name: Install run: yarn install --immutable