Browse Source

refine caching

Yuki Takei 6 years ago
parent
commit
ab8fc60411
1 changed files with 13 additions and 12 deletions
  1. 13 12
      .github/workflows/ci.yml

+ 13 - 12
.github/workflows/ci.yml

@@ -26,9 +26,9 @@ jobs:
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-
+          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache.outputs.cache-hit != 'true'
       if: steps.cache.outputs.cache-hit != 'true'
       run: |
       run: |
@@ -70,9 +70,9 @@ jobs:
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-
+          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache.outputs.cache-hit != 'true'
       if: steps.cache.outputs.cache-hit != 'true'
       run: |
       run: |
@@ -120,9 +120,9 @@ jobs:
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+        key: ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-
+          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
       if: steps.cache.outputs.cache-hit != 'true'
       if: steps.cache.outputs.cache-hit != 'true'
       run: |
       run: |
@@ -164,11 +164,12 @@ jobs:
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
         path: node_modules
         path: node_modules
-        key: ${{ runner.OS }}-node_modules-prod-${{ matrix.node-version }}-$GITHUB_SHA
+        key: $GITHUB_SHA
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
-          ${{ runner.OS }}-node_modules-dev-${{ matrix.node-version }}-
+          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
+          ${{ runner.OS }}-node_modules-${{ matrix.node-version }}-
     - name: Install dependencies
     - name: Install dependencies
+      if: steps.cache-dependencies.outputs.cache-hit != 'true'
       run: |
       run: |
         yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker growi-plugin-attachment-refs react-images react-motion
         yarn add growi-plugin-lsx growi-plugin-pukiwiki-like-linker growi-plugin-attachment-refs react-images react-motion
     - name: Print dependencies
     - name: Print dependencies
@@ -187,10 +188,10 @@ jobs:
       id: cache-public
       id: cache-public
       uses: actions/cache@v1
       uses: actions/cache@v1
       with:
       with:
-        path: node_modules
-        key: ${{ runner.OS }}-public-prod-${{ matrix.node-version }}-${{ env.GIT_BRANCH }}-${{ env.TODAY }}
+        path: public
+        key: ${{ runner.OS }}-public-${{ matrix.node-version }}-${{ env.GIT_BRANCH }}-${{ env.TODAY }}
         restore-keys: |
         restore-keys: |
-          ${{ runner.OS }}-public-prod-${{ matrix.node-version }}-${{ env.GIT_BRANCH }}-
+          ${{ runner.OS }}-public-${{ matrix.node-version }}-${{ env.GIT_BRANCH }}-
     - name: yarn build:prod
     - name: yarn build:prod
       if: steps.cache-public.outputs.cache-hit != 'true'
       if: steps.cache-public.outputs.cache-hit != 'true'
       run: |
       run: |