branches:
  except:
  - gh-pages

language: ruby

cache:
  bundler: true
  directories:
    - vendor/bundler

env:
  global:
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true  # speeds up installation of html-proofer
  - secure: "X3DRF4IOel11IO+BuPy4iMYNKAULzHI5QR1sIIIlOVEPIqkaR25H/VEDNjd9ewTOWLXYDipoeAJ1XTINIQNx5no168rKPBRRKCplsOXoZqrZYVbNOABWYYlIFeG6qBp0M5fOIPODmQ4DkpGOhwvhUbHGaTqt3R6VoSAMeutlNm4="

before_install:
  - make doctor

install:
  - make install

script:
  - make check
  - make test

after_success: >
  echo $TRAVIS_BRANCH; echo $TRAVIS_PULL_REQUEST;
  if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
    # Generate HTML
    make build ;
    # Configure Git with Travis CI information
    git config --global user.email "travis@travis-ci.org" ;
    git config --global user.name "travis-ci" ;
    # Delete the current repository
    rm -rf .git ;
    # Rebuild the repository from the generated files and push to GitHub pages
    cd _site ;
    git init ;
    git add . ;
    git commit -m "Deploy Travis CI build $TRAVIS_BUILD_NUMBER to GitHub pages" ;
    git push -f https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG} master:gh-pages ;
  fi

notifications:
  email:
    on_success: never
    on_failure: change

branches:
  except:
  - gh-pages

language: ruby

cache:
  bundler: true
  directories:
    - vendor/bundler

env:
  global:
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true  # speeds up installation of html-proofer

before_install:
  - make doctor

install:
  - make install

script:
  - make check
  - make test

after_success: >
  echo $TRAVIS_BRANCH; echo $TRAVIS_PULL_REQUEST;
  if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then
    # Generate HTML
    make build ;
    # Configure Git with Travis CI information
    git config --global user.email "travis@travis-ci.org" ;
    git config --global user.name "travis-ci" ;
    # Delete the current repository
    rm -rf .git ;
    # Rebuild the repository from the generated files and push to GitHub pages
    cd _site ;
    git init ;
    git add . ;
    git commit -m "Deploy Travis CI build $TRAVIS_BUILD_NUMBER to GitHub pages" ;
    git push -f https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG} master:gh-pages ;
  fi

notifications:
  email:
    on_success: never
    on_failure: change

Move GitHub Token to Travis CI settings
Move GitHub Token to Travis CI settings
