From 90d5bca5943f2d5113c1c4f9c39297c2abe2e365 Mon Sep 17 00:00:00 2001 From: r7kamura Date: Mon, 25 Dec 2023 08:36:36 +0900 Subject: [PATCH] Improve CI npm cache --- .github/workflows/publish.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3f892ae95bb..faf8a6a0c9b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,8 +19,14 @@ jobs: - uses: actions/setup-node@v3 with: node-version-file: package.json - cache: npm - - run: npm install + - id: cache-node-modules + uses: actions/cache@v3 + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('.node-version') }}-${{ hashFiles('package-lock.json') }} + restore-keys: node-modules-${{ runner.os }}-${{ hashFiles('.node-version') }}-${{ hashFiles('package-lock.json') }} + - if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: npm ci - run: npm run export env: ARTICLES_DIRECTORY_PATHS: ./r7kamura.com/articles