version: 2
jobs:
  build:
    docker:
      - image: circleci/node:8.5

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: yarn

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      - run: yarn test --ci --testResultsProcessor="jest-junit"

      - store_test_results:
          path: junit.xml

      - run: yarn lint
      - run: yarn build
      - run: yarn build-storybook
      - run: bash <(curl -s https://codecov.io/bash)

      - deploy:
          name: Maybe Deploy
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              ./deploy.sh "${CIRCLE_BRANCH}" release
            elif [ ! -z "${CIRCLE_TAG}" ]; then
              ./deploy.sh "${CIRCLE_TAG}" "${CIRCLE_TAG}"
            fi

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:8.5

    working_directory: ~/repo

    steps:
      - checkout

      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: yarn

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      - run: yarn test --ci --testResultsProcessor="jest-junit"

      - store_test_results:
          path: junit.xml

      - run: yarn lint
      - run: yarn build
      - run: yarn build-storybook
      - run: bash <(curl -s https://codecov.io/bash)

      - deploy:
          name: Maybe Deploy
          command: |
            if [ "${CIRCLE_BRANCH}" == "quasar" ]; then
              ./deploy.sh "${CIRCLE_BRANCH}" release
            elif [ ! -z "${CIRCLE_TAG}" ]; then
              ./deploy.sh "${CIRCLE_TAG}" "${CIRCLE_TAG}"
            fi

Deploy quasar branch as release
Deploy quasar branch as release
