Skip to content

Commit

Permalink
Create npm-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
neolao authored Dec 27, 2019
1 parent 653b90b commit daa4e13
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: npm-publish
on:
push:
branches:
- "*.*.x"

jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Check version changes
uses: EndBug/[email protected]
id: check

- name: Version update detected
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change! -> ${{ steps.check.outputs.type }}"'

- name: Set up Node.js for NPM
if: steps.check.outputs.changed == 'true'
uses: actions/[email protected]
with:
registry-url: 'https://registry.npmjs.org'
node-version: '10.x'

- name: Install dependencies
if: steps.check.outputs.changed == 'true'
run: npm ci

- name: Publish package to NPM
if: steps.check.outputs.changed == 'true'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit daa4e13

Please sign in to comment.