-
Notifications
You must be signed in to change notification settings - Fork 1
/
_deploy.sh
29 lines (22 loc) · 844 Bytes
/
_deploy.sh
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
#!/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 index.html 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 "chore: automatic build update" || true
git push origin gh-pages