name: Publish
on:
  push:
    branches: [master]

jobs:
  publish-npm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          registry-url: https://registry.npmjs.org/
      - run: yarn
        env:
          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
      - run: yarn run lerna publish from-package --yes
        env:
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

  publish-gpr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          registry-url: https://npm.pkg.github.com/
      - run: yarn
        env:
          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
      - run: yarn run lerna publish from-package --yes
        env:
          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

name: Publish
on:
  push:
    branches: [master]

jobs:
  publish-npm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          registry-url: https://registry.npmjs.org/
      - run: yarn
      - run: git stash
      - run: yarn run lerna publish from-package --yes
        env:
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

  publish-gpr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          registry-url: https://npm.pkg.github.com/
      - run: yarn
      - run: git stash
      - run: yarn run lerna publish from-package --yes
        env:
          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

Deploy action: revert git stash
Deploy action: revert git stash
