-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path_deploy.sh
More file actions
35 lines (22 loc) · 838 Bytes
/
_deploy.sh
File metadata and controls
35 lines (22 loc) · 838 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
34
35
#!/bin/bash
# Configure your name and email if you have not done so
git config --global user.email ${EMAIL}
git config --global user.name ${USERNAME}
# Ensure that the book will only be updated when the build is
# triggered from the master branch.
[ "${TRAVIS_BRANCH}" != "master" ] && exit 0
[ "${TRAVIS_PULL_REQUEST}" != "false" ] && exit 0
# Clone the repository to the book-output directory
git clone -b gh-pages \
https://${GITHUB_PAT}@github.com/${TRAVIS_REPO_SLUG}.git \
book-output
# Copy locally built *.html files into
cp -r docs/* book-output
# Create .nojekyll file to prevent git from trying to build
# html pages with jekyll.
touch book-output/.nojekyll
# Add the locally built files to a commit and push
cd book-output
git add . -f
git commit -m "Automatic build update" || true
git push origin gh-pages