Skip to content

Merge pull request #6 from DuncanMcPherson/publishing #7

Merge pull request #6 from DuncanMcPherson/publishing

Merge pull request #6 from DuncanMcPherson/publishing #7

Workflow file for this run

name: 'Deploy package to npm'
on:
workflow_dispatch:
push:
branches:
- master
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
build_pack_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
- run: npm ci && npm run build
- run: npm whoami
- run: npm pack
- run: npm publish
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os}}-build-${{ hashFiles('**/package-lock.json') }}
- run: npm ci && npm run test
- name: Upload coverage to codecov
if: always()
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}