Skip to content

Instantly share code, notes, and snippets.

@constgen
Last active July 4, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save constgen/7e84de3a5042ad5a93b75dc16adb1d69 to your computer and use it in GitHub Desktop.
Save constgen/7e84de3a5042ad5a93b75dc16adb1d69 to your computer and use it in GitHub Desktop.
GitHub Action for NPM publishing
name: Publish
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish
name: Test
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Dependencies
run: npm install
- name: Run Tests
run: npm test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment