version: 2.1
jobs:
  build:
    docker:
      - image: circleci/node:11.9
    steps:
      - checkout

      - restore_cache:
          key: yarn_lock-{{ checksum "yarn.lock" }}

      - run:
          name: Install Node dependencies
          command: yarn --frozen-lockfile

      - save_cache:
          key: yarn_lock-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
            - ./node_modules

      - run:
          name: Lint source code
          command: yarn lint

      - run:
          name: Run unit tests
          command: |
            yarn test --reporter xunit --reporter-options output=reports/mocha/test-results.xml

      - store_test_results:
          path: ./reports
      - store_artifacts:
          path: ./reports
          destination: tests/

      - run:
          name: Build client package
          command: |
            rm -rf dist # Clean the output directory before building
            yarn build:prod

      - deploy:
          name: Deploy client assets to GitHub Pages
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              
            fi

      - store_artifacts:
          path: dist
          destination: dist

workflows:
  build-deploy:
    jobs:
      - build:
          filters:
            branches:
              ignore:
                - gh-pages

version: 2.1
jobs:
  build:
    docker:
      - image: circleci/node:11.9
    steps:
      - checkout

      - restore_cache:
          key: yarn_lock-{{ checksum "yarn.lock" }}

      - run:
          name: Install Node dependencies
          command: yarn --frozen-lockfile

      - save_cache:
          key: yarn_lock-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
            - ./node_modules

      - run:
          name: Lint source code
          command: yarn lint

      - run:
          name: Run unit tests
          command: |
            yarn test --reporter xunit --reporter-options output=reports/mocha/test-results.xml

      - store_test_results:
          path: ./reports
      - store_artifacts:
          path: ./reports
          destination: tests/

      - run:
          name: Build client package
          command: |
            rm -rf dist # Clean the output directory before building
            yarn build:prod

      - deploy:
          name: Deploy client assets to GitHub Pages
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              
            fi

      - store_artifacts:
          path: dist
          destination: dist

Revert "Ignore deployment branch in CircleCI"
Revert "Ignore deployment branch in CircleCI"

This reverts commit d5953923d2c993d776626a8ace5e30af3354bc24.
