fix(travis): clean-up unusable push to github.io repo for prs

This commit is contained in:
actionless 2020-08-10 04:55:53 +02:00
parent 54c60679db
commit 4b7fe528fd
1 changed files with 2 additions and 15 deletions

View File

@ -44,23 +44,11 @@ addons:
# working copy to be there for updating already.
before_install:
- |
if [ -n "$GH_APIDOC_TOKEN" ]; then
if [ -n "$GH_APIDOC_TOKEN" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] ; then
set -e
git clone \
https://${GH_APIDOC_TOKEN}@github.com/awesomeWM/awesomeWM.github.io \
"$BUILD_WEB" 2>&1 | sed "s/$GH_APIDOC_TOKEN/GH_APIDOC_TOKEN/g"
if [ "$TRAVIS_PULL_REQUEST" = false ]; then
branch="$TRAVIS_BRANCH"
else
branch="pr-$TRAVIS_PULL_REQUEST"
fi
if [ "$branch" != master ]; then
cd $BUILD_WEB
if ! git checkout -b "$branch" "origin/$branch"; then
git checkout -b "$branch"
fi
cd -
fi
fi
install:
@ -87,8 +75,7 @@ script:
after_success:
- |
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi
if [ -n "$GH_APIDOC_TOKEN" ]; then
if [ -n "$GH_APIDOC_TOKEN" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] ; then
set -e
commit_hash=$(git rev-parse --short HEAD)
cd $BUILD_WEB