-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·33 lines (25 loc) · 776 Bytes
/
deploy.sh
File metadata and controls
executable file
·33 lines (25 loc) · 776 Bytes
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
32
33
#!/bin/bash
set -ev
if [ -z "${TRAVIS_BRANCH:-}" ]; then
echo "This script may only be run from Travis!"
exit 1
fi
if [ "$TRAVIS_BRANCH" != "master" ]; then
echo "This commit was made against '$TRAVIS_BRANCH' and not master! No deploy!"
exit 0
fi
if [ ! -d "out" ]; then
echo "Run build.sh first"
exit 1
fi
echo "Committing book directory to gh-pages branch"
REV=$(git rev-parse --short HEAD)
cd out
git init
git remote add upstream "https://${GH_TOKEN}@github.com/brson/rust-anthology.git"
git config user.name "Rust Anthology"
git config user.email "banderson@mozilla.com"
git add -A .
git commit -qm "Build Rust Anthology at ${TRAVIS_REPO_SLUG}@${REV}"
echo "Pushing gh-pages to GitHub"
git push -q upstream HEAD:refs/heads/gh-pages --force