# Used on master and staging branches
name: Production CI

on:
  push:
    # Sequence of patterns matched against refs/heads
    branches:
      - 'master' # Push events on master branch
      - 'next' # Push events on staging branch
      - 'alpha' # Push events on alpha branch
      - 'beta' # Push events on beta branch

jobs:
  test:
    name: Test, Build & Release
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node: ['14']

    steps:
      - uses: actions/checkout@v2

      - name: Setup node
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node }}
          cache: 'yarn'

      - name: Install Dependencies
        run: yarn install

      # - name: Tests
      #   run: yarn test

      - name: Build
        run: yarn build

      - name: Semantic Release
        run: npx semantic-release@16
        env:
          GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
