defaults: &defaults
  working_directory: /usr/src/app
  docker:
    - image: aa8y/sbt:ci

version: 2
jobs:
  build:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - build-dependencies-{{ checksum "build.sbt" }}
          - sbt-dependencies--{{ checksum "project/build.properties" }}
      - run: sbt clean coverage +test
      - save_cache:
          paths:
            - ~/.ivy2/cache
            - ~/.m2
          key: build-dependencies--{{ checksum "build.sbt" }}
      - save_cache:
          paths:
            - ~/.sbt
          key: sbt-dependencies--{{ checksum "project/build.properties" }}
      - persist_to_workspace:
          root: /usr/src
          paths:
            - app

  deploy:
    <<: *defaults
    environment:
      SBT_GHPAGES_COMMIT_MESSAGE: 'Publishing Scaladoc [ci skip]'
    steps:
      - attach_workspace:
          at: /usr/src
      - run: sbt updateImpactSubmit coverageReport coverageAggregate codacyCoverage
      - run: bash <(curl -s https://codecov.io/bash)
      - run: git config --global user.email "pathikritbhowmick@msn.com"
      - run: git config --global user.name "circle-ci"
      - run: git config --global push.default simple
      - run: sbt ghpagesPushSite +publish
workflows:
  version: 2
  build-coverage-deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build
          filters:
            branches:
              only: master

defaults: &defaults
  working_directory: /usr/src/app
  docker:
    - image: aa8y/sbt:ci

version: 2
jobs:
  build:
    <<: *defaults
    steps:
      - checkout
      - restore_cache:
          keys:
          - build-dependencies-{{ checksum "build.sbt" }}
          - sbt-dependencies--{{ checksum "project/build.properties" }}
      - run: sbt clean coverage +test
      - save_cache:
          paths:
            - ~/.ivy2/cache
            - ~/.m2
          key: build-dependencies--{{ checksum "build.sbt" }}
      - save_cache:
          paths:
            - ~/.sbt
          key: sbt-dependencies--{{ checksum "project/build.properties" }}
      - persist_to_workspace:
          root: /usr/src
          paths:
            - app

  deploy:
    <<: *defaults
    environment:
      SBT_GHPAGES_COMMIT_MESSAGE: 'Publishing Scaladoc [ci skip]'
    steps:
      - attach_workspace:
          at: /usr/src
      - run: sbt updateImpactSubmit coverageReport coverageAggregate codacyCoverage
      - run: bash <(curl -s https://codecov.io/bash)
      - run: git config --global user.email "pathikritbhowmick@msn.com"
      - run: git config --global user.name "circle-ci"
      - run: git config --global push.default simple
      - run: mkdir ~/.ssh && ssh-keyscan github.com > ~/.ssh/known_hosts
      - run: sbt ghpagesPushSite +publish
workflows:
  version: 2
  build-coverage-deploy:
    jobs:
      - build
      - deploy:
          requires:
            - build
          filters:
            branches:
              only: master

Fix the authenticity of 'github.com'
Fix the authenticity of 'github.com'
