version: 2 jobs: build-common: &common-build docker: - image: node working_directory: ~/diff2html steps: &common-steps - checkout - restore_cache: key: dependency-cache-{{ checksum "yarn.lock" }} - run: yarn - save_cache: key: dependency-cache-{{ checksum "yarn.lock" }} paths: - ./node_modules - run: yarn run build - run: yarn run coverage build-latest: &latest-build docker: - image: node working_directory: ~/diff2html steps: - checkout - restore_cache: key: dependency-cache-{{ checksum "yarn.lock" }} - run: yarn - save_cache: key: dependency-cache-{{ checksum "yarn.lock" }} paths: - ./node_modules - run: yarn run build - run: yarn run lint - run: yarn run coverage - run: yarn run codacy - persist_to_workspace: root: ~/diff2html paths: - docs - build build-node_8: <<: *common-build docker: - image: node:8 build-node_10: <<: *common-build docker: - image: node:10 build-node_11: <<: *common-build docker: - image: node:11 build-node_12: <<: *common-build docker: - image: node:12 build-node_13: <<: *latest-build docker: - image: node:13 deploy: machine: enabled: true working_directory: ~/diff2html steps: - attach_workspace: at: . - run: name: Deploy working_directory: ~/diff2html/docs command: aws s3 sync . s3://diff2html.xyz --region eu-west-1 workflows: version: 2 build: jobs: - build-node_10 - build-node_11 - build-node_12 - build-node_13 - deploy: requires: - build-node_13 filters: branches: only: master