1 Star 0 Fork 0

XianxueYu/interpretable-ml-book

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
_build_and_deploy.sh 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
Christoph Molnar 提交于 2019-09-16 13:15 . Fix paths
#!/bin/sh
set -e # Exit with nonzero exit code if anything fails
# Copied from here: https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
SOURCE_BRANCH="master"
TARGET_BRANCH="gh-pages"
LEANPUB_BRANCH="leanpub"
BUILD_COMMIT_MSG="Update book (travis build ${TRAVIS_BUILD_NUMBER})"
BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
# Create datasets
Rscript scripts/prepare_data.R
cd manuscript
# Create references
make -B 11-references.Rmd
# Compile html version of book for gh-pages
make -B html
# Compile md version of book for leanpub
# make -B leanpub
cd ..
## Only deploy when on master branch of main repository
if [ "$BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ] ; then
echo "Deploying master to gh-pages."
# Clone the existing gh-pages for this repo into out/
# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deply)
git clone -b $TARGET_BRANCH https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git out
cd out
git rm -rf ./*
cp -r ../manuscript/_book/* ./
touch .nojekyll
git add .nojekyll
git add --all ./*
# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
git config credential.helper "store --file=.git/credentials"
echo "https://${GH_TOKEN}:@github.com" > .git/credentials
git commit -m "${BUILD_COMMIT_MSG}" --allow-empty
# Now that we're all set up, we can push.
git push origin $TARGET_BRANCH
# echo "Deploying master to leanpub branch."
# cd ../
# rm -r out
# git add -f manuscript/*.md
# git add -f images/*
# git commit -m "${BUILD_COMMIT_MSG}"
# git push origin $LEANPUB_BRANCH
else
echo "Changes are not being deployed, since this is a fork / branch."
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xianxueyu/interpretable-ml-book.git
[email protected]:xianxueyu/interpretable-ml-book.git
xianxueyu
interpretable-ml-book
interpretable-ml-book
master

搜索帮助