From 759c245979b42ac355cbc583f438d91a8220147b Mon Sep 17 00:00:00 2001 From: henk <111544927+ariqnrnns@users.noreply.github.com> Date: Mon, 21 Nov 2022 10:19:36 +0000 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f89e4a6 --- /dev/null +++ b/.github/workflows/build.yml @@ -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