message: chore(ci): add release and deploy flows for circleci
diff: version: 2
  jobs:
  - test:
  + system:
  docker:
  - image: circleci/node:10.15-browsers
  working_directory: ~/repo
  @@ -25,8 +25,94 @@ jobs:
  yarn ci-check
  yarn lerna run ci-check
  + deploy:
  + docker:
  + - image: circleci/node:10.15-browsers
  + working_directory: ~/repo
  + steps:
  + - checkout
  + - run:
  + name: Install yarn
  + command: |
  + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.16.0
  + # Reference:
  + # https://circleci.com/docs/2.0/env-vars/#example-configuration-of-environment-variables
  + echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> $BASH_ENV
  + - run:
  + name: Install dependencies
  + command: yarn install --offline --frozen-lockfile
  + - run:
  + name: Build packages
  + command: yarn build
  + - deploy:
  + name: deploy to IBM Cloud
  + command: |
  + # Install `ibmcloud` CLI
  + curl -fsSL https://clis.ng.bluemix.net/install/linux | sh
  +
  + # Login and push staging manifest
  + ibmcloud login \
  + --apikey $CLOUD_API_KEY \
  + -a https://api.ng.bluemix.net \
  + -o carbon-design-system
  +
  + ibmcloud target -s production
  +
  + ibmcloud cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org
  + ibmcloud cf install-plugin blue-green-deploy -f -r CF-Community
  +
  + # Default storybook build
  + cd packages/react
  + yarn build-storybook
  + ibmcloud cf blue-green-deploy carbon-storybook \
  + -f manifest.yml \
  + --delete-old-apps
  +
  + release:
  + docker:
  + - image: circleci/node:10.15-browsers
  + working_directory: ~/repo
  + steps:
  + - checkout
  + - run:
  + name: Install yarn
  + command: |
  + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.16.0
  + # Reference:
  + # https://circleci.com/docs/2.0/env-vars/#example-configuration-of-environment-variables
  + echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> $BASH_ENV
  + - run:
  + name: Install dependencies
  + command: yarn install --offline --frozen-lockfile
  + - run:
  + name: Build packages
  + command: yarn build
  + - run:
  + name: Publish canary packages
  + command: |
  + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
  + yarn lerna publish --canary minor --dist-tag canary --no-push --no-git-tag-version --yes
  +
  workflows:
  version: 2
  main:
  jobs:
  - - test
  + - system
  + - release:
  + requires:
  + - system
  + - artifacts
  + filters:
  + branches:
  + only:
  + - circleci-release
  + - deploy:
  + requires:
  + - system
  + - artifacts
  + filters:
  + branches:
  + ignore: /.*/
  + tags:
  + only: /^v\d+\.\d+\.\d+$/
  +
  