docs.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. echo "Deploying docs to website osqp.org..."
  3. # Update variables from install
  4. # Anaconda
  5. export PATH=${DEPS_DIR}/miniconda/bin:$PATH
  6. hash -r
  7. source activate testenv
  8. if [[ $TRAVIS_OS_NAME == "linux" ]]; then
  9. # Install dependencies
  10. # Add PPA to make doxygen installation work
  11. sudo add-apt-repository ppa:libreoffice/ppa -y
  12. sudo apt-get update -q -y
  13. sudo apt-get install -y doxygen
  14. conda install -y sphinx
  15. conda install -y -c conda-forge sphinx_rtd_theme breathe
  16. # Enter in docs folder
  17. cd ${TRAVIS_BUILD_DIR}/docs/
  18. # Create docs
  19. make html
  20. # Clone website repository
  21. cd $HOME/
  22. git clone "https://${OSQP_DOCS_DEPLOY_GH_TOKEN}@github.com/oxfordcontrol/osqp.org.git"
  23. cd osqp.org/src/docs/
  24. # Update git config to push
  25. git config user.name "OSQP Docs Builder"
  26. git config user.email "$OSQP_DOCS_DEPLOY_EMAIL"
  27. # Copy in the docs HTML
  28. cp -R ${TRAVIS_BUILD_DIR}/docs/_build/html/* ./
  29. # Add and commit changes.
  30. git add -A .
  31. git commit --allow-empty -m "Generated docs for commit $TRAVIS_COMMIT"
  32. # -q is very important, otherwise you leak your GH_TOKEN
  33. git push -q origin master
  34. fi