Skip to content

Commit

Permalink
fix(github-workflow): Caching yarn.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlcz committed Oct 24, 2024
1 parent 8520548 commit b241d5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies and run tests on node version 14.x

name: Affirmations CI
run-name: ${{ github.actor }} is running Affirmations CI on Node 14.x
run-name: ${{ github.actor }} is running Affirmations CI on branch ${{ GITHUB_REF#refs/heads/ }}

on: [push]

Expand All @@ -17,11 +17,16 @@ jobs:
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Installing dependencies
run: npm i
run: |
if [ -f yarn.lock ]; then
yarn install
else
npm install
fi
- name: Building application
run: npm run build --if-present
- name: Running tests
Expand Down

0 comments on commit b241d5e

Please sign in to comment.