publish_gh_page.sh 885 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # Add Github deploy key for opensheetmusicdisplay/opensheetmusicdisplay.github.io.git
  3. echo $GH_PAGES_DEPLOY_KEY > privatedeploykey
  4. chmod 400 ./privatedeploykey
  5. ssh-add ./privatedeploykey
  6. # Prepare files to be published
  7. grunt docs
  8. grunt build:demo
  9. # Clone github page
  10. git clone git@github.com:opensheetmusicdisplay/opensheetmusicdisplay.github.io.git
  11. cd opensheetmusicdisplay.github.io
  12. git status
  13. # Copy class documentation
  14. rsync -a ../build/docs/* ./
  15. # Copy demo application
  16. rsync -a ../build/demo/* ./demo
  17. # Commit and push changes
  18. git status
  19. git add *
  20. git commit -m "Pushed auto-generated class documentation and demo for $TRAVIS_TAG"
  21. git tag -a $TRAVIS_TAG -m "Class documentation and demo for $TRAVIS_TAG"
  22. git push origin master --follow-tags
  23. echo "Deployed class documentation and demo for $TRAVIS_TAG successfully."
  24. cd ..
  25. rm -rf opensheetmusicdisplay.github.io