Skip to content

Commit 560802b

Browse files
author
Christopher Pardy
committed
Add Linting to CI, split deployment
Add Linting to the CI and move deployment out of the on pull request bit so it doesn't trigger on pull requests.
1 parent 8e1cf47 commit 560802b

File tree

2 files changed

+44
-7
lines changed

2 files changed

+44
-7
lines changed

Diff for: .github/workflows/deploy.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Deploy Package
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [14.x, 16.x, 18.x]
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- run: npm install
26+
- run: npm run build --if-present
27+
- run: npm run lint
28+
- run: npm test
29+
deploy:
30+
needs: build
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-node@v1
35+
with:
36+
node-version: 18.x
37+
- run: npm install
38+
- run: npm run build --if-present
39+
# https://github.com/marketplace/actions/npm-publish
40+
- uses: JS-DevTools/npm-publish@v2
41+
with:
42+
token: ${{ secrets.NPM_TOKEN }}

Diff for: .github/workflows/node.js.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
name: Node.js CI
55

66
on:
7-
push:
8-
branches: [ master, next-major ]
97
pull_request:
108
branches: [ master, next-major ]
119

@@ -16,7 +14,7 @@ jobs:
1614

1715
strategy:
1816
matrix:
19-
node-version: [18.x]
17+
node-version: [14.x, 16.x, 18.x]
2018

2119
steps:
2220
- uses: actions/checkout@v2
@@ -26,8 +24,5 @@ jobs:
2624
node-version: ${{ matrix.node-version }}
2725
- run: npm install
2826
- run: npm run build --if-present
27+
- run: npm run lint
2928
- run: npm test
30-
# https://github.com/marketplace/actions/npm-publish
31-
- uses: JS-DevTools/npm-publish@v2
32-
with:
33-
token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)