name: Publish to NPM

on:
    create:
        tags:
            - 'v*'

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - uses: actions/setup-node@v1
              with:
                  node-version: '12.19.0'
                  registry-url: https://registry.npmjs.org/
            - run: npm install
            - run: npm publish
              env:
                  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

name: Publish to NPM

on:
    push:
        tags:
            - 'v*'

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
            - uses: actions/setup-node@v1
              with:
                  node-version: '12.19.0'
                  registry-url: https://registry.npmjs.org/
            - run: npm install
            - run: npm publish
              env:
                  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Change workflow trigger from create to push event
:wrench: Change workflow trigger from create to push event