Merge pull request #3 from TeskaLabs/feature/keep-repo-up-to-date #11
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: NodeJS with Webpack | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.10.0] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: "https://registry.npmjs.org/" | |
always-auth: true | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile # Do not need a lock file for this library | |
- name: Build library | |
run: pnpm build | |
- name: Publish to npm | |
if: startsWith(github.ref, 'refs/tags/') # Runs only when a tag is pushed | |
run: | | |
pnpm publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }} |