# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2

defaults: &defaults
  working_directory: ~/repo
  docker:
    - image: circleci/node:15.4.0

jobs:
  prettier-check:
    <<: *defaults
    steps:
      - checkout
      - run:
          name: Install deps
          command: npm install
      - run:
          name: Run Prettier over all files
          command: npm run prettier-check
  build:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/repo
      - run:
          name: Install deps
          command: npm install
      - run:
          name: Build assets
          command: npm build
workflows:
  version: 2
  test-deploy:
    jobs:
      - prettier-check
      - build
