name: Publish to npm.pkg.github.com on: push: tags: - 'v*' jobs: build-and-publish: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: node-version: '16.x' registry-url: 'https://npm.pkg.github.com' - name: Install dependencies and build run: npm install && npm run build - name: Publish package to npm.pkg.github.com run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}