Skip to content

Commit

Permalink
Merge pull request #271 from byu-oit/setup-node-cache
Browse files Browse the repository at this point in the history
Use GHA caching built into `actions/setup-node@v2`
  • Loading branch information
GaryGSC committed Aug 9, 2021
2 parents 4f47a2e + 3da163d commit 6f19fbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/ci.yml
Expand Up @@ -74,13 +74,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm
cache-dependency-path: '**/package-lock.json'

- name: npm ci
working-directory: src
Expand All @@ -107,6 +102,8 @@ jobs:
with:
node-version: ${{ env.node_version }}

# We don't need to install deps to audit them

- name: npm audit
working-directory: src
run: npm audit --audit-level=critical
Expand All @@ -121,13 +118,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm
cache-dependency-path: '**/package-lock.json'

- name: npm ci
working-directory: src
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/deploy.yml
Expand Up @@ -109,13 +109,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ env.node_version }}

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm
cache-dependency-path: '**/package-lock.json'

- name: Audit
working-directory: src
Expand Down

0 comments on commit 6f19fbe

Please sign in to comment.