Skip to content

Merge pull request #2 from fernandosavio/creating-gh-actions #2

Merge pull request #2 from fernandosavio/creating-gh-actions

Merge pull request #2 from fernandosavio/creating-gh-actions #2

Workflow file for this run

name: Node.js Package
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm test
publish-npm:
if: startsWith(github.ref, 'refs/tags/') # only publish on tag pushes
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
scope: '@fsavio'
cache: 'npm'
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}