mirror of
https://github.com/swc-project/swc.git
synced 2024-12-28 08:04:43 +03:00
travis: fix doc upload (#47)
This commit is contained in:
parent
2a169c451b
commit
bbd9ec9eb9
20
.travis.yml
20
.travis.yml
@ -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:
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user