Skip to content

Commit

Permalink
Merge pull request #338 from RateGravity/lint-on-build
Browse files Browse the repository at this point in the history
Add Linting to CI, split deployment
  • Loading branch information
chris-pardy authored Jul 3, 2023
2 parents 8e1cf47 + 560802b commit 0f8ca50
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Deploy Package

on:
push:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build --if-present
- run: npm run lint
- run: npm test
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 18.x
- run: npm install
- run: npm run build --if-present
# https://github.com/marketplace/actions/npm-publish
- uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
9 changes: 2 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
name: Node.js CI

on:
push:
branches: [ master, next-major ]
pull_request:
branches: [ master, next-major ]

Expand All @@ -16,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -26,8 +24,5 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build --if-present
- run: npm run lint
- run: npm test
# https://github.com/marketplace/actions/npm-publish
- uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}

0 comments on commit 0f8ca50

Please sign in to comment.