Skip to content

Extend service groups #8

Extend service groups

Extend service groups #8

name: Node.js package
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: https://npm.pkg.github.com
NPM_TOKEN: ${{ secrets.REGISTRY_NPM_TOKEN }}
jobs:
build-test-publish:
runs-on: ubuntu-latest
timeout-minutes: 4
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20.x"
- run: (echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}"; cat .npmrc) > .npmrc2 && mv .npmrc2 .npmrc
env:
NPM_TOKEN: ${{ env.NPM_TOKEN }}
- run: npm install
- run: npm run build
- run: npm test
- uses: JS-DevTools/npm-publish@v1
if: ${{ github.ref == 'refs/heads/main' }}
with:
registry: ${{ env.REGISTRY }}
token: ${{ env.NPM_TOKEN }}