Publish to NPM #20
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: "Publish to NPM" | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
publish-to-npm: | |
name: "Publish to NPM" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Cache node_modules | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
- run: npm ci | |
- run: npm run build | |
- run: npm run publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |