Skip to content

Npm.js deploy

Npm.js deploy #30

Workflow file for this run

name: Npm.js deploy
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
- run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- run: echo ${VERSION}
- run: echo "NG_CLI_ANALYTICS=false" >> $GITHUB_ENV
- run: echo "NODE_OPTIONS='--max_old_space_size=4096'" >> $GITHUB_ENV
- run: npm ci
- run: grunt build
# define npm tag
- run: if [[ ${VERSION} == *"alpha"* || ${VERSION} == *"beta"* || ${VERSION} == *"rc"* ]]; then echo "NPM_TAG=next"; else echo "NPM_TAG=latest"; fi >> $GITHUB_ENV
- run: echo ${NPM_TAG}
# copy readme
- run: cp ../README.md README.md
working-directory: dist
# create version and publish it to npmjs
- run: npm version ${VERSION} --no-git-tag-version --save --verbose
working-directory: dist
- run: npm publish --tag ${NPM_TAG}
working-directory: dist
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}