sudo: false
branches:
  only:
    - i18n

language: node_js
node_js:
  - 'lts/carbon'
script: true
before_install:
  - sudo apt-get install ruby
  - gem install bundler
install:
  - node --version
  - npm --version
  - nvm --version
  - yarn --version
  - gem --version
  - bundle --version
  - bundle install
  - bundle exec jekyll build
  - yarn
  - yarn run build
after_success:
  - git config user.name 'TravisCI Auto-publisher'
  - git config user.email 'travis-auto-publish@example.com'
  - if [ "$TRAVIS_PULL_REQUEST" = false ]; then
      printf '#!/bin/sh -e\necho %s' "$GH_PUBLISH_TOKEN" > gh-publish-pass.sh &&
      chmod u+x gh-publish-pass.sh &&
      yarn run build &&
      GLOBIGNORE='.git:_site' &&
      rm -r * &&
      mv _site/* ./ &&
      rm -r _site/ &&
      git add . &&
      git commit -m 'Auto-publishing via TravisCI' &&
      GIT_ASKPASS=./gh-publish-pass.sh git push origin +HEAD:refs/heads/master;
    fi

sudo: false
branches:
  only:
    - i18n

language: node_js
node_js:
  - 'lts/carbon'
script: true
before_install:
  - gem install bundler
  - gem --version
  - bundle install
  - bundle --version
  - yarn
install:
  - yarn run build
  - bundle exec jekyll build
after_success:
  - git config user.name 'TravisCI Auto-publisher'
  - git config user.email 'travis-auto-publish@example.com'
  - if [ "$TRAVIS_PULL_REQUEST" = false ]; then
      GLOBIGNORE='.git:_site' &&
      rm -r * &&
      mv _site/* ./ &&
      rm -r _site/ &&
      git add . &&
      printf '#!/bin/sh -e\necho %s' "$GH_PUBLISH_TOKEN" > gh-publish-pass.sh &&
      chmod u+x gh-publish-pass.sh &&
      git commit -m 'Auto-publishing via TravisCI' &&
      GIT_ASKPASS=./gh-publish-pass.sh git push origin +HEAD:refs/heads/master;
    fi

Test auto-deply _site folder - Attempt 2
Test auto-deply _site folder - Attempt 2
