on: push

name: Build and Publish

jobs:
  all:
    name: Build and Publish
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Cache node_modules
      id: cache-modules
      uses: actions/cache@v1
      with:
        path: node_modules
        key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }}
    - name: Build
      if: steps.cache-modules.outputs.cache-hit != 'true'
      run: npm install
    - name: Test
      run: npm test
    - name: Publish
      if: github.ref == 'refs/heads/master'
      uses: mikeal/merge-release@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Add GitHub Actions for build and publish
Add GitHub Actions for build and publish