# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Publish packages

on:
  push:
    branches: [ master ]
  workflow_dispatch:
    branches: [ master ]
  repository_dispatch:
    types: deploy-master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Install Node.js 12.16.1
      uses: actions/setup-node@v1
      with:
        node-version: '12.16.1'
    - name: Install packages
      run: npm install
    - name: Build package on npmjs
      run: npm run build
    - name: Publish package on npmjs
      run: npm publish --access public
      env:
        NPM_TOKEN: ${{ secrets.NPM_TOKEN }}