Skip to content

Commit

Permalink
Use CI to update documentation (appium#11731)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgraham committed Dec 11, 2018
1 parent a2ff1b5 commit 372171f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 118 deletions.
50 changes: 47 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,34 @@ jobs:
script: npm run test && npm run e2e-test
node_js: "8"
- stage:
os: linux
os: osx
if: branch = master
env:
# this is just to indicate in the Travis job list that this is generating docs
- GENERATE_DOCS=true
script: npm run generate-docs
- GENERATE_DOCS=true GITHUB_TOKEN=$TRIAGER_BOT_TOKEN
before_script:
- brew install hub
- hub --version
- git remote set-url origin https://triager:$TRIAGER_BOT_TOKEN@github.com/appium/appium
- git reset --hard origin/master
- git checkout -b generate-docs-$TRAVIS_COMMIT
- npm install

script:
# Generate the docs
- npm run generate-docs

# If no docs were generated, don't do anything
- |
if [[ -z $(git status -s) ]]; then
exit 0
fi
# Make a PR to update the docs
- git commit -a -n -m 'Update generated docs [ci skip]'
- git push origin generate-docs-$TRAVIS_COMMIT
- hub pull-request -b "appium:master" -h "appium:generate-docs-$TRAVIS_COMMIT" -m "Update auto-generated docs"

- stage: BinTray Bundle Build and Upload
# only want to run this on the main master branch
if: branch = master AND type != pull_request
Expand All @@ -55,3 +78,24 @@ jobs:
# Remove the dev depenedencies
- npm prune
script: npm run zip-and-upload
- stage: Update Documentation
if: tag
os: osx
env:
- HUB_VERBOSE=true GITHUB_TOKEN=$TRIAGER_BOT_TOKEN
before_script:
- brew install hub
- pip install mkdocs==0.16.3

# Checkout appium.io repository
- git clone https://triager:$TRIAGER_BOT_TOKEN@github.com/appium/appium.io.git --branch=gh-pages && cd appium.io/
- git checkout -b docs-$TRAVIS_TAG
- bundle install
- npm install

script:
# Build the docs and make a PR to get them on appium.io
- npm run build:docs
- git commit -a -n -m 'Updated docs for latest Appium version'
- git push origin docs-$TRAVIS_TAG
- hub pull-request -b "appium:gh-pages" -h "appium:docs-$TRAVIS_TAG" -m "Update documentation for latest version" | exit 0 # The PR command works but always returns non-negative
115 changes: 0 additions & 115 deletions docs/en/commands/example.md

This file was deleted.

0 comments on commit 372171f

Please sign in to comment.