name: release
on: [push]
jobs:
  release:
    runs-on: ubuntu-20.04
    name: Release
    if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 16
      - name: Setup node cache
        uses: actions/cache@v2
        with:
          key: vhops-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
          path: |
            node_modules
      - name: Release
        env:
          GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npx semantic-release@17.4.7
