travis: fix doc upload (#47)

This commit is contained in:
강동윤 2018-11-10 18:15:15 +09:00 committed by GitHub
parent 2a169c451b
commit bbd9ec9eb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 38 deletions

View File

@ -23,8 +23,8 @@ before_install:
- git submodule update --init --recursive
script:
- cargo build --color always --all --all-targets
- cargo test --color always --all
- cargo doc --color always
after_success:
# Temporarily disabled because cargo tarpaulin does not set CARGO_MANIFEST_DIR.
@ -33,9 +33,21 @@ after_success:
# - |
# cargo tarpaulin --all --ignore-tests --out Xml &&
# bash <(curl -s https://codecov.io/bash)
- '[ $TRAVIS_PULL_REQUEST = false ] &&
[ "$TRAVIS_BRANCH" == "master" ] &&
./.travis/docs.sh'
# - '[ $TRAVIS_PULL_REQUEST = false ] &&
# [ "$TRAVIS_BRANCH" == "master" ] &&
# ./.travis/docs.sh'
deploy:
local_dir: $CARGO_TARGET_DIR/doc
repo: swc-project/swc
target_branch: gh-pages
provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
email: kdy1@outlook.kr
name: "강동윤"
on:
branch: master
notifications:
email: never
env:

View File

@ -1,34 +0,0 @@
#!/bin/bash
# Copied from https://github.com/hyperium/hyper/blob/master/.travis/docs.sh
# which is MIT-licensed.
set -o errexit
shopt -s globstar
cargo doc
git clone --branch gh-pages "https://$GH_TOKEN@github.com/${TRAVIS_REPO_SLUG}.git" deploy_docs > /dev/null 2>&1
cd deploy_docs
git config user.name "강동윤"
git config user.email "kdy1@outlook.kr"
if [ "$TRAVIS_TAG" = "" ]; then
rm -rf master
mv ../target/doc ./master
echo "<meta http-equiv=refresh content=0;url=swc/index.html>" > ./master/index.html
fi
git add -A . > /dev/null 2>&1
git commit -q -m "rebuild pages at ${TRAVIS_COMMIT}"
echo
echo "Pushing docs..."
git push --quiet origin gh-pages > /dev/null 2>&1
echo
echo "Docs published."
echo