language: node_js
node_js:
  - "6"

before_install:
  - "npm install -g surge"

script:
  - npm test
  - npm run build

deploy:
  # Deploy the style guide
  - provider: script
    script: node scripts/deploy.js
    on:
      master
    skip_cleanup: true
  - provider: script
    script: node scripts/publish.js --NPM_TOKEN=$NPM_TOKEN
    skip_cleanup: true

language: node_js
node_js:
  - "6"

before_install:
  - "npm install -g surge"

before_script:
  - npm test

script:
  - npm run build

deploy:
  - provider: script
    script: node scripts/deploy.js
    on:
      master
    skip_cleanup: true
  - provider: script
    script: node scripts/publish.js --NPM_TOKEN=$NPM_TOKEN
    skip_cleanup: true

Move test to before_script so that the process aborts if tests fail
Move test to before_script so that the process aborts if tests fail
