message: Only deploy on master. Skip PRs.
diff: require(`shelljs/global`);
  const GIT_USER = process.env.GIT_USER;
  +const CIRCLE_BRANCH = process.env.CIRCLE_BRANCH;
  const CIRCLE_PROJECT_USERNAME = process.env.CIRCLE_PROJECT_USERNAME;
  const CIRCLE_PROJECT_REPONAME = process.env.CIRCLE_PROJECT_REPONAME;
  +const CI_PULL_REQUEST = process.env.CI_PULL_REQUEST;
  const remoteBranch = `https://${GIT_USER}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git`;
  if (!which(`git`)) {
  @@ -14,6 +16,13 @@ if (!which(`git`)) {
  exit(1);
  }
  +if (CI_PULL_REQUEST || CIRCLE_BRANCH !== `master` || CIRCLE_PROJECT_USERNAME !== `facebook`) {
  + echo(`Skipping deploy`);
  + exit(0);
  +}
  +
  +echo(`Building branch ${CIRCLE_BRANCH}, preparing to push to gh-pages`);
  +
  // Clear out existing build folder
  rm(`-rf`, `build`);
  mkdir(`-p`, `build`);
  @@ -39,7 +48,7 @@ if (exec(`git checkout origin/gh-pages`).code +
  cd(`../..`);
  if (exec(`node server/generate.js`).code) {
  - echo(`Error: generate failed`);
  + echo(`Error: Generating HTML failed`);
  exit(1);
  }
  