language: python

python:
  - '3.3'

env:
  global:
    - secure: nyEE3CAtUUxfIxggMPaMjHSMxn5b2n2Bzcj1MdE8mgBIkNihAkZ6evXLJstspGPEGWyGIJMEEJOJZmVTxXfg4FbrM5TBdFZtLZbXjZTR4vJmxqH2nOlCVVclOlXSDdbOUtsLMz7d2yHYwObQ4MqB7z16y7Jf/o/apjZ2faP/dDM=

script:
  - npm install
  - grunt karma:continuous
  - python py/minify.py

after_success:
  - cd $HOME
  - git config --global user.email "${GIT_EMAIL}"
  - git config --global user.name "${GIT_NAME}"
  - git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/sniksnp/image-slider-game gh-pages > /dev/null
  - cd gh-pages
  - git rm -rf * .gitignore
  - cp -Rf $HOME/build/sniksnp/image-slider-game/minified.html $HOME/build/sniksnp/image-slider-game/im .
  - mv minified.html index.html
  - git add -f .
  - git commit -m "Travis build $TRAVIS_BUILD_NUMBER"
  - git push -fq origin gh-pages > /dev/null
