From 07fe2dda9eb1f9a4ad3958f2cee51c665724b131 Mon Sep 17 00:00:00 2001 From: lkzc19 Date: Thu, 25 Jul 2024 23:13:16 +0800 Subject: [PATCH] ci: ci cache test --- .github/workflows/ci-cache-node.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cache-node.yml b/.github/workflows/ci-cache-node.yml index 09771ed..e6d4346 100644 --- a/.github/workflows/ci-cache-node.yml +++ b/.github/workflows/ci-cache-node.yml @@ -19,14 +19,24 @@ jobs: uses: actions/setup-node@v4 with: node-version: "20" - - name: Cache node_modules + - name: Restore uses: actions/cache@v4 with: path: | node_modules key: ci-cache-node-${{ hashFiles('v-poc/ci/cache-node/package-lock.json') }} - - name: NPM + - name: Install dependencies + if: steps.cache-dependencies.outputs.cache-hit != 'true' run: | cd ${{ env.WORKSPACE }} npm install + - name: Build + run: | + cd ${{ env.WORKSPACE }} npm run build + - name: Cache + if: success() + uses: actions/cache@v4 + with: + path: node_modules + key: ci-cache-node-${{ hashFiles('v-poc/ci/cache-node/package-lock.json') }}