Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15641f6

Browse files
committed
close rstudio/bookdown#133: an example of using Travis to build the book
1 parent c194531 commit 15641f6

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
language: r
2+
3+
env:
4+
global:
5+
- secure: "dCJPbgnWgIr+tHvTa/1X5HIJ3QzRLuQwQ8owh7PrcQnNL8taWToBv+4OR+DPKaE+CVpsBIbIYKl7PtzfvTqfOqRnFuZVOPaVgf6Pe+xSekSN4XpGfbiC3cjEV6ALv0T720BHQhDX1NqUGgjK0oU9rdPxWLdp3iEDTC2KD6u5hYdXRKy1O8w7P4V8KHZiOt2Hq8azOggWSAvjDJqrbbh1DOdPjUrC8GH9EegZ9REL8sPBtyayLn7YB/xq76oeAghlyJbTV1+wY/Xew4hnpk2AA1PArjI73H+dPUEUR/rojJamYQ/7YUqJZQd9/Ss01BKzla9UUFF69aQ+oROu2wd5qFnpH35uhMD6sgWaCvYDSehAZDB1DMQEDbiGFpogCzyHma3/JbQVPqMJdRsHQPDoNzWbapCY58HUyPgd7GbdnjGqj8vRYip//kK2ELJxlUZQRmS3/pS3BudpBOGh/D6lGYFUiybDhW3ZD5L5KqZ5Z2F+luIeUzmG3sZcQ+c7ilFcVMQLYl5D/ckNnI+iTVHuLEBgn6XTwtQNBprAz02rL0/nk7fzlfHFr/y8t2kcKOhn3YbStthnyMhSxvhA+UNk0+JJprnUbTMPG7IvEDpJtSv1npcgXNRO2Ldb4ynt6eAozakJmSX/sd5EC2bnzXXbzv7cIBQUbL+6SN6jjxYhT9A="
6+
7+
r_github_packages:
8+
- rstudio/bookdown
9+
10+
install: true
11+
12+
before_script:
13+
- chmod +x ./_build.sh
14+
- chmod +x ./_deploy.sh
15+
16+
script:
17+
- ./_build.sh
18+
- ./_deploy.sh

DESCRIPTION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Package: placeholder
2+
Title: Does not matter.
3+
Version: 0.0.1

_build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::gitbook')"

_deploy.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
[ -z "${GH_TOKEN}" ] && exit 0
6+
[ "${TRAVIS_BRANCH}" != "master" ] && exit 0
7+
8+
git clone -b gh-pages https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git book-output
9+
cd book-output
10+
cp -r ../_book/* ./
11+
git add --all *
12+
git commit -m"Update the book"
13+
git push origin gh-pages

0 commit comments

Comments
 (0)