v1.2.4 #21
Workflow file for this run
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: Node.js Package | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
id-token: write | |
pages: write | |
packages: write | |
env: | |
GPR_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jobs: | |
build: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://npm.pkg.github.com/ | |
cache: 'npm' | |
- name: Register additional private repositories | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=\${GPR_AUTH_TOKEN}" >> .npmrc | |
echo "@inway:registry=https://npm.pkg.github.com" >> .npmrc | |
- run: npm ci | |
- run: npm run build | |
- run: npm run test | |
- run: npm run docs | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload typedocs | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './docs' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://npm.pkg.github.com/ | |
- name: Register additional private repositories | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=\${GPR_AUTH_TOKEN}" >> .npmrc | |
echo "@inway:registry=https://npm.pkg.github.com" >> .npmrc | |
- run: npm ci | |
- run: npm run build | |
- name: Publish to GPR | |
run: npm publish | |
continue-on-error: true | |
- name: Switch publishing to npmjs.org | |
run: | | |
echo "//registry.npmjs.org/:_authToken=\${NPM_AUTH_TOKEN}" >> .npmrc | |
echo "@inway:registry=https://registry.npmjs.org" >> .npmrc | |
- name: Publish to npmjs.org | |
run: npm publish |