version: 2 jobs: components-build: docker: - image: circleci/node:8 steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: yarn install - save_cache: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} - run: yarn test - run: yarn build-storybook - persist_to_workspace: root: . paths: storybook-static components-deploy: docker: - image: circleci/node:8 steps: - checkout - attach_workspace: at: . - run: name: Install and configure dependencies command: sudo npm install -g gh-pages@2.0.1 && git config user.email "julien@status.im" && git config user.name "jeluard" - add_ssh_keys: fingerprints: - "88:41:2a:73:d4:c5:f2:4a:35:89:7e:0a:56:83:45:1e" - run: name: Deploy docs to gh-pages branch command: gh-pages --dotfiles --message "Auto generated commit" --dist storybook-static workflows: version: 2 build: jobs: - components-build - components-deploy: requires: - components-build