forked from nodeSolidServer/solid-auth-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis_publish
executable file
·31 lines (26 loc) · 979 Bytes
/
.travis_publish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
REPO_NAME="solid/solid-auth-client"
PUBLICATION_BRANCH=gh-pages
# Only publish from the main repository's master branch
if [ "$TRAVIS_REPO_SLUG" != "$REPO_NAME" ] || [ "$TRAVIS_BRANCH" != "master" ] || [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit; fi
echo -e "Building $PUBLICATION_BRANCH...\n"
# Checkout the branch
REPO_PATH=$PWD
pushd $HOME
git clone --quiet --depth=1 --branch=$PUBLICATION_BRANCH https://${GH_TOKEN}@github.com/$REPO_NAME publish 2>&1 > /dev/null
cd publish
# Don't update if already at the latest version
if [[ `git log -1 --pretty=%B` == *$TRAVIS_COMMIT* ]]; then exit; fi
# Update pages
rm -r * 2> /dev/null
mkdir dist
cp $REPO_PATH/README* .
cp -r $REPO_PATH/dist-lib/* dist
cp -r $REPO_PATH/dist-popup/* dist
# Commit and push latest version
git add .
git config user.name "Travis"
git config user.email "[email protected]"
git commit -m "Update to $TRAVIS_COMMIT."
git push -fq origin $PUBLICATION_BRANCH 2>&1 > /dev/null
popd