Create build.yml

This commit is contained in:
henk 2022-11-21 10:19:36 +00:00
parent c8cfdbed1c
commit 759c245979

38
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,38 @@
# This workflow will do a clean installation of node dependencies, cache/restore them & build the source code across node 16, node 17, & node 18.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build
on:
push:
branches: main
pull_request:
branches: main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 17.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
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 }}-
- name: install dependencies
run: npm install
- name: build
run: npm run build