Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try deploying gh-pages only if change to docs dir #704

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,7 @@ script:

before_deploy:
- cd docs && doxygen Doxyfile
deploy:
provider: pages
skip_cleanup: true
github-token: $GH_TOKEN
local_dir: docs/
keep-history: true
on:
branch: master
script: ./scripts/deploy.sh
after_success:
env:
matrix:
Expand Down
18 changes: 18 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# check to see if the docs directory changed - if not,
# then git will return a 0 exit code. If it did change,
# then git will return a 1. Only deploy the docs directory
# if a change occurred.
testchange=`git diff --exit-code -- docs > /dev/null`
if [ $? -ne 0 ]; then
deploy:
provider: pages
skip_cleanup: true
github-token: $GH_TOKEN
local_dir: docs/
keep-history: true
on:
branch: master
fi