File: .travis_build_pages

package info (click to toggle)
node-n3 1.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 780 kB
  • sloc: javascript: 7,999; makefile: 18; sh: 1
file content (26 lines) | stat: -rwxr-xr-x 840 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
# Only publish from the main repository's master branch
REPO_NAME="RubenVerborgh/N3.js"
if [ "$TRAVIS_REPO_SLUG" != "$REPO_NAME" ] || [ "$TRAVIS_BRANCH" != "master" ] || [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit; fi
echo -e "Generating gh-pages...\n"

# Checkout the gh-pages branch
REPO_PATH=$PWD
pushd $HOME
git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/$REPO_NAME gh-pages 2>&1 > /dev/null
cd gh-pages

# Don't update if already at the latest version
if [[ `git log -1 --pretty=%B` == *$TRAVIS_COMMIT* ]]; then exit; fi

# Update pages
rm -r docs 2> /dev/null
cp -r $REPO_PATH/docs .

# Commit and push latest version
git add .
git config user.name  "Travis"
git config user.email "travis@travis-ci.org"
git commit -m "Update to $TRAVIS_COMMIT."
git push -fq origin gh-pages 2>&1 > /dev/null
popd