在 CircleCi 中的不同作业之间共享步骤的结果

Share result of a step between different jobs in CircleCi

我在 CircleCi 中有这个通用的 config.yml

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:7.10
    steps:
      - checkout
      - run: npm install
      - run: npm run lint
  deploy:
    machine: true
    steps:
      - checkout
      - run: npm install
      - run: npm run build

如您所见,npm install被调用了两次,这是一个重复的任务。

是否可以在 2 个作业之间共享 npm install 的结果? 最终目标是只安装一次包。

您正在寻找的是工作区:https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs