Skip to content

Commit

Permalink
push gh-pages from travis if docs change
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Mar 29, 2016
1 parent 32f3825 commit a476db7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ node_js:
after_script:
- codeclimate-test-reporter < coverage/lcov.info
- coveralls < coverage/lcov.info
- scripts/travis-gh-pages
4 changes: 2 additions & 2 deletions COERCION.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Possible type coercions:
|---|:-:|:-:|:-:|:-:|
|string |-|`x`&rarr;`""+x`|`false`&rarr;`"false"`<br>`true`&rarr;`"true"`|`null`&rarr;`""`|
|number /<br>integer|Valid number /<br>integer: `x`&rarr;`+x`<br>|-|`false`&rarr;`0`<br>`true`&rarr;`1`|`null`&rarr;`0`|
|boolean |`"false"`&rarr;`false`<br>`"true"`&rarr;`true`<br>`"abc"`&nrarr;<br>`""`&nrarr;|`0`&rarr;`false`<br>`1`&rarr;`true`<br>`x`&nrarr;|-|`null`&rarr;`false`|
|null |`""`&rarr;`null`<br>`"null"`&nrarr;<br>`"abc"`&nrarr;|`0`&rarr;`null`<br>`x`&nrarr;|`false`&rarr;`null`<br>`true`&nrarr;|-|
|boolean |`"false"`&rarr;`false`<br>`"true"`&rarr;`true`<br>`"abc"`&#8696;<br>`""`&#8696;|`0`&rarr;`false`<br>`1`&rarr;`true`<br>`x`&#8696;|-|`null`&rarr;`false`|
|null |`""`&rarr;`null`<br>`"null"`&#8696;<br>`"abc"`&#8696;|`0`&rarr;`null`<br>`x`&#8696;|`false`&rarr;`null`<br>`true`&#8696;|-|


## Coersion from string values
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ajv - Another JSON Schema Validator
# Ajv: Another JSON Schema Validator

Currently the fastest JSON Schema validator for node.js and browser.

Expand Down
17 changes: 17 additions & 0 deletions scripts/travis-gh-pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -e

if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$' && {
rm -rf ../gh-pages
git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/epoberezkin/ajv.git ../gh-pages
cp *.md ../gh-pages/_source
cp LICENSE ../gh-pages/_source
cd ../gh-pages
./generate
git add .
git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER"
git push origin gh-pages
}
fi

0 comments on commit a476db7

Please sign in to comment.