-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (45 loc) · 1.34 KB
/
node-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Node Build
on:
pull_request:
paths:
- src/**
- .eslintrc.js
- stylelint.config.js
- webpack.js
push:
branches:
- main
paths:
- src/**
- .eslintrc.js
- stylelint.config.js
- webpack.js
jobs:
build:
name: node-build
runs-on: ubuntu-latest
steps:
- name: Set app env
run: echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #
with:
path: ${{ env.APP_NAME }}
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
id: versions
with:
path: ${{ env.APP_NAME }}
fallbackNode: "^20"
fallbackNpm: "^9"
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"
- name: Build ${{ env.APP_NAME }}
run: |
cd ${{ env.APP_NAME }}
npm ci
npm run build