Skip to content
Harry Turnbull edited this page May 27, 2020 · 1 revision

Continuous Integration and Deployment with Travis CI to Surge

Set up Travis

  • Activate the repo on Travis.
  • Add .travis.yml to root, which specifies deployment with surge and surge domain name.
language: node_js
node_js:
  - "stable"
cache:
  directories:
    - node_modules
script:
  - npm test
  - npm run build
deploy:
  provider: surge
  skip_cleanup: true
  domain: <whatever_name_here>.surge.sh
  project: ./build/
on:
  branch: master

Set up Surge Credentials

  • Add SURGE_LOGIN key to travis environment variables, with value of your surge email.
  • Get your surge token by running surge token in your terminal.
  • Add SURGE_TOKEN key to travis environment variables, with value of your surge token.

Push to Travis

  • Commit and push.
  • Travis will start a build.
  • All tests must pass for Travis to deploy.

Clone this wiki locally