Skip to content

Commit 3440d7c

Browse files
committed
Uploading multiple versions of ts-docs into git hub pages
1 parent 53fd8e1 commit 3440d7c

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ script:
1616
- touch ./ts-docs/.nojekyll
1717
- if [ "$TRAVIS_NODE_VERSION" = "8" ]; then npm run coveralls-report; fi
1818
deploy:
19-
- provider: pages
19+
- provider: script
2020
skip_cleanup: true
21-
local_dir: ts-docs
22-
keep_history: true
23-
github_token: $GITHUB_TOKEN
21+
script: /bin/sh travis/github-pages.sh
2422
on:
2523
branch: master
26-
node_js: "8"
24+
node_js: "9"
2725
- provider: script
2826
skip_cleanup: true
2927
script: /bin/sh travis/uploadArchives.sh

travis/github-pages.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
PUBLICATION_BRANCH=gh-pages
5+
# Checkout the branch
6+
REPO_PATH=$PWD
7+
CURRENT_VERSION=$(npm run version --silent)
8+
rm -rf $HOME/publish
9+
cd $HOME
10+
git clone --branch=$PUBLICATION_BRANCH https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG publish 2>&1 > /dev/null
11+
cd publish
12+
# Update pages
13+
14+
cp -r $REPO_PATH/ts-docs/. ./
15+
# Commit and push latest version
16+
git add .
17+
git config user.name "Travis"
18+
git config user.email "travis@travis-ci.org"
19+
git commit -m "Uploading $CURRENT_VERSION docs."
20+
git push -fq origin $PUBLICATION_BRANCH 2>&1 > /dev/null
21+
cd $REPO_PATH

0 commit comments

Comments
 (0)