@@ -2,10 +2,10 @@ name: Update Main Cache
22
33# This workflow is responsible for maintaining an updated cache of node_modules on the 'main' branch.
44# It's triggered on every push to the 'main' branch. It checks out the code, sets up Node.js, and caches
5- # the node_modules folder, using a key that is specific to the 'main' branch and the hash of the 'yarn. lock' file.
6- # If the 'yarn. lock' file has not changed since the last push to 'main', the existing cache will be reused.
7- # If the 'yarn. lock' file has changed, a new cache will be created. This ensures that the cache is always
8- # up-to-date with the latest dependencies defined in 'yarn. lock'. This cache can then be used by workflows
5+ # the node_modules folder, using a key that is specific to the 'main' branch and the hash of the 'package- lock.json ' file.
6+ # If the 'package- lock.json ' file has not changed since the last push to 'main', the existing cache will be reused.
7+ # If the 'package- lock.json ' file has changed, a new cache will be created. This ensures that the cache is always
8+ # up-to-date with the latest dependencies defined in 'package- lock.json '. This cache can then be used by workflows
99# in pull requests to speed up the build process by reusing the installed dependencies.
1010
1111on :
3333 uses : actions/setup-node@v3
3434 with :
3535 node-version : ${{ matrix.node-version }}
36- cache : ' yarn '
36+ cache : ' npm '
3737
3838 # Cache node_modules to speed up future builds
3939 - name : Cache node modules
@@ -43,12 +43,12 @@ jobs:
4343 cache-name : cache-node-modules
4444 with :
4545 path : node_modules
46- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn. lock', '**/package.json') }}
46+ key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package- lock.json ', '**/package.json') }}
4747 restore-keys : |
4848 ${{ runner.os }}-build-${{ env.cache-name }}-
4949 ${{ runner.os }}-build-
5050 ${{ runner.os }}-
5151
5252 # Install dependencies to update the cache
5353 - name : Install Dependencies
54- run : yarn install --frozen-lockfile
54+ run : npm ci
0 commit comments