Skip to content

Commit

Permalink
fix(pipeline): cache yarn deps with corepack
Browse files Browse the repository at this point in the history
  • Loading branch information
vscaiceanu-1a committed Nov 5, 2024
1 parent 57d295f commit b909057
Showing 1 changed file with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,26 @@ runs:
steps:
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
cache: <%= packageManager %>
node-version: 20<% if (packageManager === 'npm') { %>
cache: npm<% } %>
- name: Enable Corepack
shell: bash
run: corepack enable
- name: Install
<% if (npmRegistry) { %>
run: corepack enable<% if (packageManager === 'yarn') { %>
- name: Cache dependencies
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: |
.yarn/cache
.yarn/unplugged
.pnp.cjs
.pnp.loader.mjs
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-deps
${{ runner.os }}<% } %>
- name: Install<% if (npmRegistry) { %>
env:
COREPACK_NPM_REGISTRY: <%= npmRegistry %>
COREPACK_INTEGRITY_KEYS: ""
<% } %>
COREPACK_INTEGRITY_KEYS: ""<% } %>
shell: bash
run: <%= setupCommand %>

0 comments on commit b909057

Please sign in to comment.