workflows:
  version: 2
  node-multi-build:
    jobs:
      - test
      - deploy:
          filters:
            branches:
              only: master
          requires:
            - test
  reserved-posts:
    jobs:
      - deploy
    triggers:
      - schedule:
          cron: '0 0,6,12,18 * * *' # On 6 hours
          filters:
            branches:
              only:
                - master

version: 2
jobs:
  base: &base
    docker:
      - image: node:8
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
            - v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-{{ checksum "package-lock.json" }}
            - v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-
      - run: npm install
      - run: npx lerna bootstrap
      - save_cache:
          paths:
            - node_modules
            - plugins/gatsby-remark-discoverable-oembed/node_modules
          key: v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-{{ checksum "package-lock.json" }}
      - run: npm run lint
      - run: npm test
  test:
    <<: *base
  deploy:
    <<: *base
    steps:
      - checkout
      - restore_cache:
          keys:
            - v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-{{ checksum "package-lock.json" }}
      - run: curl -X POST -d '{}' "$NETLIFY_BUILD_HOOK_URL?trigger_branch=master&trigger_title=trigger-from-circleci"

workflows:
  version: 2
  node-multi-build:
    jobs:
      - test
      - deploy:
          filters:
            branches:
              only: master
          requires:
            - test
  reserved-posts:
    jobs:
      - deploy
    triggers:
      - schedule:
          cron: '0 0,6,12,18 * * *' # On 6 hours
          filters:
            branches:
              only:
                - master

version: 2
jobs:
  base: &base
    docker:
      - image: node:8
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
            - v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-{{ checksum "package-lock.json" }}
            - v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-
      - run: npm install
      - run: npx lerna bootstrap
      - save_cache:
          paths:
            - node_modules
            - plugins/gatsby-remark-discoverable-oembed/node_modules
            - plugins/gatsby-remark-expand-github-embedded-code-snippet/node_modules
          key: v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-{{ checksum "package-lock.json" }}
      - run: npm run lint
      - run: npm test
  test:
    <<: *base
  deploy:
    <<: *base
    steps:
      - checkout
      - restore_cache:
          keys:
            - v{{ .Environment.CIRCLECI_CACHE_VERSION }}-dependencies-{{ checksum "package-lock.json" }}
      - run: curl -X POST -d '{}' "$NETLIFY_BUILD_HOOK_URL?trigger_branch=master&trigger_title=trigger-from-circleci"

Add gatsby-remark-expand-github-embedded-code-snippet to list of cache
Add gatsby-remark-expand-github-embedded-code-snippet to list of cache
