Skip to content

Commit 923466b

Browse files
authored
Merge pull request #69 from lgeiger/deploy-docs
Deploy docs on master
2 parents 8329be6 + 447322c commit 923466b

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ script: if [[ -z "$ELECTRON" ]]; then travis_retry npm run coverage; else travis
4343
after_success:
4444
- 'if [[ $DEPLOY == true && $TRAVIS_OS_NAME == linux]]; then bash <(curl -s https://codecov.io/bash); fi'
4545

46+
after_sucess:
47+
- bash ./scripts/publish_docs.sh
48+
4649
deploy:
4750
provider: script
4851
skip_cleanup: true
4952
# Linking to prebuild directly since it doesn't work inside a npm script.
5053
script:
5154
- node_modules/prebuild/bin.js --all -u $GH_TOKEN
52-
- bash ./travis_publish_docs.sh
5355
on:
5456
condition: "$DEPLOY = true"
5557
tags: true

scripts/publish_docs.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
#!/bin/bash
2+
if [[ $TRAVIS_PULL_REQUEST == false && $TRAVIS_BRANCH == "master" && $DEPLOY == "true" ]]
3+
then
4+
npm run build:docs
25

3-
npm run build:docs
6+
( cd docs
7+
git init
8+
git config user.email "travis@travis-ci.com"
9+
git config user.name "Travis Bot"
410

5-
( cd docs
6-
git init
7-
git config user.email "travis@travis-ci.com"
8-
git config user.name "Travis Bot"
9-
10-
git add .
11-
git commit -m "Publish docs from $TRAVIS_BUILD_NUMBER"
12-
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
13-
echo "Documentation has been published!"
14-
)
11+
git add .
12+
git commit -m "Publish docs from $TRAVIS_BUILD_NUMBER"
13+
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
14+
echo "Documentation has been published!"
15+
)
16+
else
17+
echo "Documentation has not been published because not on master!"
18+
fi

0 commit comments

Comments
 (0)