version: 2.1
orbs:
    node: circleci/node@5.1.0

jobs:
    build_and_test:
        executor: node/default
        steps:
            - checkout
            - node/install-packages:
              pkg-manager: npm
            - run:
              command: npm run build
              name: Build app
            - run:
              command: npm run test
              name: Run tests
            - run:
              command: npm run build-website
              name: Build documentation
            - persist_to_workspace:
              root: ~/project
              paths:
                  - .
