First pass a npm test, build and publish template

This commit is contained in:
Mike Coutermarsh
2019-08-07 13:32:43 -07:00
parent d033b087b7
commit 3608610340
2 changed files with 53 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
name: Test, build and publish NPM package
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
version: 12
- run: npm ci
- run: npm test
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
version: 12
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
version: 12
registry-url: https://npm.pkg.github.com/
scope: '@your-github-username'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{github.token}}
@@ -0,0 +1,6 @@
{
"name": "Test, build and publish NPM package",
"description": "Publishes an NPM package to NPM and GitHub Package Registry",
"iconName": "octicon smiley",
"categories": ["Automation", "SDLC"]
}