Skip to content

Commit

Permalink
Caching deps in build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dexter committed Mar 31, 2023
1 parent 11260de commit 4cae81d
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,27 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@v3
- uses: pnpm/action-setup@v2
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
version: 7.30.0
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install dependencies
run: npm ci
- name: Build application
- name: Build
run: NODE_ENV=production npm run build
- name: 'Upload build'
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 4cae81d

Please sign in to comment.