forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-deploy.sh
executable file
·27 lines (25 loc) · 981 Bytes
/
travis-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
#!/bin/sh
set -ex
deploy() {
git config --global user.email "[email protected]"
git config --global user.name "Travis CI User"
git clone https://github.com/haskell/cabal-website.git cabal-website
(cd cabal-website && git checkout --track -b gh-pages origin/gh-pages)
rm -rf cabal-website/doc
mkdir -p cabal-website/doc/html
mv dist-newstyle/build/Cabal-2.1.0.0/doc/html/Cabal \
cabal-website/doc/html/Cabal
(cd cabal-website && git add --all .)
(cd cabal-website && \
git commit --amend --reset-author -m "Deploy to GitHub ($(date)).")
(cd cabal-website && \
git push --force [email protected]:haskell/cabal-website.git \
gh-pages:gh-pages)
}
if [ "x$TRAVIS_REPO_SLUG" = "xhaskell/cabal" \
-a "x$TRAVIS_PULL_REQUEST" = "xfalse" \
-a "x$TRAVIS_BRANCH" = "xmaster" \
-a "x$DEPLOY_DOCS" = "xYES" ]
then
deploy
fi