rtic/ci/after-success.sh

28 lines
617 B
Bash
Raw Normal View History

2018-08-27 14:44:47 +02:00
set -euxo pipefail
main() {
2018-11-03 17:02:41 +01:00
rm -f .cargo/config
cargo doc --features timer-queue
( cd book && mdbook build )
2018-08-27 14:44:47 +02:00
2018-11-03 17:02:41 +01:00
local td=$(mktemp -d)
cp -r target/doc $td/api
cp -r book/book $td/
cp LICENSE-* $td/book/
2018-08-27 14:44:47 +02:00
2018-11-03 17:02:41 +01:00
mkdir ghp-import
2018-08-27 14:44:47 +02:00
curl -Ls https://github.com/davisp/ghp-import/archive/master.tar.gz |
tar --strip-components 1 -C ghp-import -xz
2018-11-03 17:02:41 +01:00
./ghp-import/ghp_import.py $td
2018-08-27 14:44:47 +02:00
set +x
git push -fq https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git gh-pages && echo OK
2018-11-03 17:02:41 +01:00
rm -rf $td
2018-08-27 14:44:47 +02:00
}
2018-11-03 17:02:41 +01:00
if [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]; then
2018-08-27 14:44:47 +02:00
main
fi