Quantcast
Channel: CircleCI Discuss - Latest posts
Viewing all articles
Browse latest Browse all 14895

Access yarn cache from another job

$
0
0

I’ve been looking around but I can’t seem to find anything that can help my use case. I just need to have the node_modules available on the client_build job.

version: 2
jobs:
  set_up_deps:
    docker:
      - image: circleci/node:10
    steps:
      - checkout
      - run:
          name: update-npm
          command: 'sudo npm i -g npm@6.9.0'
      - run:
          name: install-yarn
          command: 'sudo npm i -g yarn'
      - restore_cache:
          keys:
            - yarn-packages-{{ checksum "yarn.lock" }}
      - run:
          name: install-deps
          command: yarn install --frozen-lockfile
      - save_cache:
          key: yarn-packages-{{ checksum "yarn.lock" }}
          paths:
            - ~/.cache/yarn
  client_build:
    docker:
      - image: circleci/node:10
    steps:
      - checkout
      - restore_cache:
          keys:
            - yarn-packages-{{ checksum "yarn.lock" }}
      - run:
          name: build-client
          command: yarn client:build:prod
workflows:
  version: 2
  build:
    jobs:
      - set_up_deps
      - client_build:
          requires:
            - set_up_deps

Viewing all articles
Browse latest Browse all 14895

Latest Images

Trending Articles



Latest Images