Build failed

I kept getting errors on invalid schema, can someone help me to take a look?

version: 2
jobs:
  'build and test':
    docker:
      -
        image: 'circleci/node:10.8'
    working_directory: ~/repo
    steps:
      - checkout
      -
        restore_cache:
          keys:
            - 'v1-dependencies-{{ checksum "package.json" }}'
            - v1-dependencies-
      -
        run: 'yarn install'
      -
        save_cache:
          paths:
            - node_modules
          key: 'v1-dependencies-{{ checksum "package.json" }}'
      -
        run: 'yarn test'
  'deploy to now':
    docker:
      -
        image: 'circleci/node:10.8'
    working_directory: ~/repo
    steps:
      - checkout
      -
        restore_cache:
          keys:
            - 'v1-dependencies-{{ checksum "package.json" }}'
            - v1-dependencies-
      -
        run:
          name: 'Install Now Cli'
          command: 'yarn global add now'
      -
        run:
          name: 'Deploy to Stage'
          command: 'now --build-env NODE_ENV=Stage'
workflows:
  version: 2
  build:
    jobs:
      - 'build and test'
  deploy:
    jobs:
      - 'deploy to now':
        requires:
          - 'build and test'
        filters:
          branches:
            only: develop

My guess is that ‘build and test’ is part of the build workflow, and ‘deploy to now’ is part of deploy.
As far as I know you must include it in both workflows.Like so:

version: 2
jobs:
  'build and test':
    docker:
      - image: 'circleci/node:10.8'
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
            - 'v1-dependencies-{{ checksum "package.json" }}'
            - v1-dependencies-
      - run: 'yarn install'
      - save_cache:
          paths:
            - node_modules
          key: 'v1-dependencies-{{ checksum "package.json" }}'
      - run: 'yarn test'
  'deploy to now':
    docker:
      - image: 'circleci/node:10.8'
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
            - 'v1-dependencies-{{ checksum "package.json" }}'
            - v1-dependencies-
      - run:
          name: 'Install Now Cli'
          command: 'yarn global add now'
      - run:
          name: 'Deploy to Stage'
          command: 'now --build-env NODE_ENV=Stage'
workflows:
  version: 2
  build:
    jobs:
      - 'build and test'
  deploy:
    jobs:
      - 'build and test'
      - 'deploy to now':
          requires:
            - 'build and test'
          filters:
            branches:
              only: develop

That worked! Thank you :slight_smile: