Merge pull request #95 from sidevesh/dependabot/npm_and_yarn/example/… #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NPM Publish | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
npm-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v1 | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 10 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install dependencies | |
run: npm install | |
- name: Publish package | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | |
LATEST=`npm view . version` | |
CURRENT=`cat package.json | jq -r .version` | |
if [ "$LATEST" != "$CURRENT" ] | |
then | |
npm publish | |
fi |