version: 2.1

orbs:
  node: circleci/node@4.2.0

jobs:
  build:
    executor:
      name: node/default
      tag: "14.16"
    steps:
      - checkout
      - run: yarn install
      - run: yarn build
      - run: yarn test
  deploy:
    executor:
      name: node/default
      tag: "14.16"
    steps:
      - checkout
      - run: yarn install
      - run: yarn semantic-release

workflows:
  version: 2
  ci:
    jobs:
      - build
      - deploy:
          context: semantic-release
          requires:
            - build
          filters:
            branches:
              only: master
