File: deploy_github

package info (click to toggle)
r-cran-bookdown 0.21%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,084 kB
  • sloc: javascript: 11,155; sh: 33; makefile: 17
file content (17 lines) | stat: -rwxr-xr-x 466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

set -e

[ -z "${GH_TOKEN}" ] && exit 0
[ "${TRAVIS_BRANCH}" != "master" ] && exit 0

BOOK_DIR=$(pwd)/_book
rm -rf ~/_book
mkdir ~/_book && cd ~/_book
git clone -b gh-pages https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git .
ls | grep -v ^bookdown[.].* | xargs rm -rf
git ls-files --deleted -z | xargs -0 git rm
cp -r ${BOOK_DIR}/* ./
git add --all *
git commit -m"update homepage (travis build ${TRAVIS_BUILD_NUMBER})"
git push -q -f origin gh-pages