Skip to content

Commit

Permalink
feat: update GitHub workflow and add cache for node_modules dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
krudi committed Sep 10, 2023
1 parent 3c71f28 commit 9ce155e
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml → .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous integration
name: Install dependencies and build the project

on:
push:
Expand All @@ -11,21 +11,31 @@ on:
- develop
- main

env:
NODE: 18

jobs:
install:
name: Build and start Node.js project
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- "18"

steps:
- name: Checkout the current branch
uses: actions/checkout@main

- name: Set up Node.js
uses: actions/setup-node@main
with:
node-version: '${{ env.NODE }}'
node-version: '${{ matrix.node-version }}'

- name: Cache dependencies installed with Node Package Manager
uses: actions/cache@v3
with:
path: node_modules
key: node_modules-${{hashFiles('package-lock.json')}}
restore-keys: node_modules-

- name: Install dependencies in the project
run: npm ci
Expand Down

0 comments on commit 9ce155e

Please sign in to comment.