diff --git a/.travis.yml b/.travis.yml index 5e809d8..abe44e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ language: c compiler: clang +env: + global: + secure: "BB9eiRNXC1PfNRLEifc0yQQZnM25zqaWNGVWN+atzT+NkxhVKyVr8+DoyPYaa8tOKybuSZhVkKnIiCd8iGMe3v+WyuHKFuhdiwdnEQhxbBlUCb9dDLEexI+J8QiYwC8AW/t6H9LWVwSka0RI3GJujJ8HKIBzW45I/j+1NlUte8U=" before_script: - sudo apt-get install -qq libgmp-dev libmpfr-dev - wget http://www.flintlib.org/flint-2.4.3.tar.gz @@ -11,3 +14,6 @@ before_script: - cd .. script: - make CC=clang + - make doc +after_script: + - ./update-gh-pages.sh diff --git a/update-gh-pages.sh b/update-gh-pages.sh new file mode 100755 index 0000000..f904839 --- /dev/null +++ b/update-gh-pages.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +cd "$HOME" +git config --global user.email "travis@travis-ci.org" +git config --global user.name "travis-ci" +git clone --branch=gh-pages https://${GH_TOKEN}@github.com/hasufell/pqc gh-pages || exit 1 + +# C docs +cd gh-pages || exit 1 +echo "Removing old C docs." +git rm -rf . +echo "Adding new C docs." +cp -rf "$TRAVIS_BUILD_DIR"/doxygen/html/* . || exit 1 +git add * + +if [[ -e ./index.html ]] ; then + echo "Commiting docs." + git commit -m "Lastest doxygen docs updated + + travis build: $TRAVIS_BUILD_NUMBER + commit: $TRAVIS_COMMIT + auto-pushed to gh-pages" + git push origin gh-pages + echo "Published docs to gh-pages." +else + echo "Error docs are empty." + exit 1 +fi