version: 2 jobs: build: &shared-config docker: - image: circleci/node:lts-fermium working_directory: ~/repo steps: - checkout - restore_cache: keys: - dependencies-{{ checksum "package.json" }}-v1 - dependencies- - run: yarn install - save_cache: paths: - node_modules key: dependencies-{{ checksum "package.json" }}-v1 testUnit: <<: *shared-config steps: - checkout - restore_cache: key: dependencies-{{ checksum "package.json" }}-v1 - run: yarn test:unit server-doc-deploy: <<: *shared-config working_directory: ~/repo steps: - attach_workspace: at: /tmp - run: name: Install netlify command: yarn add netlify-cli -D - run: name: Deploy app command: yarn netlify deploy --prod --dir=/repo workflows: version: 2 build-test-and-lint: jobs: - build - testUnit: requires: - build - server-doc-deploy: requires: - build - testUnit filters: branches: only: main