machine:
  pre:
    - mkdir ~/.yarn-cache
  node:
    version: 6.9.1
  environment:
    NODE_ENV: test

dependencies:
  pre:
    - curl -o- -L https://yarnpkg.com/install.sh | bash
    # Gulp must be installed in the global environment.
    - yarn global add gulp-cli
    - yarn global add aws-cli
  cache_directories:
    - ~/.yarn-cache
  override:
    - yarn install

test:
  override:
    - yarn test
  post:
    # For Precog.
    - NODE_ENV=production gulp build
    - cp -R build data index.html embed $CIRCLE_ARTIFACTS

# For hosting on mapzen.com. Only deploy if tests pass. Compiled files are
# rebuilt for a production environment.
deployment:
  production:
    branch: master
    commands:
      - aws s3 sync $CIRCLE_ARTIFACTS $AWS_PROD_DESTINATION --delete
  # For the moment, the `next` branch also auto-deploys to dev. Note this
  # clobbers the `staging` branch. Remove if/when not needed.
  next:
    branch: next
    commands:
      - aws s3 sync $CIRCLE_ARTIFACTS $AWS_DEV_DESTINATION --delete
  staging:
    branch: staging
    commands:
      - aws s3 sync $CIRCLE_ARTIFACTS $AWS_DEV_DESTINATION --delete

machine:
  pre:
    - mkdir ~/.yarn-cache
  node:
    version: 6.9.1
  environment:
    NODE_ENV: test

dependencies:
  pre:
    - curl -o- -L https://yarnpkg.com/install.sh | bash
    # Gulp must be installed in the global environment.
    - yarn global add gulp-cli
    - yarn global add aws-cli
  cache_directories:
    - ~/.yarn-cache
  override:
    - yarn install

test:
  override:
    - yarn test
  post:
    # For Precog.
    - NODE_ENV=production gulp build
    - cp -R build data index.html embed docs $CIRCLE_ARTIFACTS

# For hosting on mapzen.com. Only deploy if tests pass. Compiled files are
# rebuilt for a production environment.
deployment:
  production:
    branch: master
    commands:
      - aws s3 sync $CIRCLE_ARTIFACTS $AWS_PROD_DESTINATION --delete
  # For the moment, the `next` branch also auto-deploys to dev. Note this
  # clobbers the `staging` branch. Remove if/when not needed.
  next:
    branch: next
    commands:
      - aws s3 sync $CIRCLE_ARTIFACTS $AWS_DEV_DESTINATION --delete
  staging:
    branch: staging
    commands:
      - aws s3 sync $CIRCLE_ARTIFACTS $AWS_DEV_DESTINATION --delete

Add docs to deploy script
Add docs to deploy script
