Github Action: Publish to NPM (#308)

* Github Action: Publish to NPM

* Delete .travis.yml

* Update nodejs.yml
This commit is contained in:
Ricardo Ambrogi
2020-02-28 13:21:25 +01:00
committed by GitHub
parent fc1769c30c
commit c0a494a4bd
2 changed files with 30 additions and 15 deletions

30
.github/workflows/npmpublish.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Node.js Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}