Skip to content

Commit

Permalink
ci: fix node_modules caching
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbyWibowo committed May 6, 2022
1 parent 5cab3b5 commit a297c9d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
NODE_VERSION: 14

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Expand All @@ -27,11 +30,18 @@ jobs:
- name: Install Node v14
uses: actions/setup-node@v3
with:
node-version: '14'
cache: 'yarn'
node-version: ${{ env.NODE_VERSION }}

- name: Cache node_modules
uses: actions/cache@v2
id: cache-nodemodules
with:
path: node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: yarn install
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --non-interactive

- name: Build application
run: yarn build
Expand Down

0 comments on commit a297c9d

Please sign in to comment.