machine:
  node:
    version: 4.0.0
dependencies:
  override:
    - npm install
test:
  override:
    - echo "test"
    
deployment:
  prod:
    branch: master
    commands:
      - npm start
      - aws s3 sync build s3://chocolate-free.com --delete
      - aws cloudfront create-invalidation --cli-input-json "{\"DistributionId\":\"$CLOUD_FRONT_INSTANCE\",\"InvalidationBatch\":{\"Paths\":{\"Quantity\":1,\"Items\":[\"/*\"]},\"CallerReference\":\"$(date +%s)\"}}"

machine:
  node:
    version: 4.0.0
dependencies:
  override:
    - npm install
post:
  - aws configure set preview.cloudfront true
  - aws configure set preview.create-invalidation true
test:
  override:
    - echo "test"
    
deployment:
  prod:
    branch: master
    commands:
      - npm start
      - aws s3 sync build s3://chocolate-free.com --delete
      - aws cloudfront create-invalidation --cli-input-json "{\"DistributionId\":\"$CLOUD_FRONT_INSTANCE\",\"InvalidationBatch\":{\"Paths\":{\"Quantity\":1,\"Items\":[\"/*\"]},\"CallerReference\":\"$(date +%s)\"}}"

Add preview to aws config
Add preview to aws config