Skip to content

Commit 1e98437

Browse files
Travis CITravis CI
Travis CI
authored and
Travis CI
committed
chore: setup deployment
1 parent d5122f8 commit 1e98437

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ install:
1313
script:
1414
- npm run lint
1515
- npm run flow -- check
16+
deploy:
17+
provider: script
18+
script: docs/deploy.sh
19+
skip_cleanup: true
20+
on:
21+
branch: master

docs/deploy.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
git clone https://${GITHUB_TOKEN}@github.com/react-native-paper/react-native-paper.github.io.git docs/dist
6+
7+
cd docs && npm run build && cd dist
8+
9+
if [ -z "$(git diff --exit-code)" ]; then
10+
echo "No changes to the output on this push; exiting."
11+
exit 0
12+
fi
13+
14+
git config user.name "Travis CI"
15+
git config user.email "[email protected]"
16+
17+
git add .
18+
git commit -m "Deploy documentation: $(git rev-parse --verify HEAD)"
19+
20+
git push -f -u origin master

docs/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import path from 'path';
44
import fs from 'fs';
5-
import del from 'del';
65
import { parse } from 'react-docgen';
76
import React from 'react';
87
import ReactDOMServer from 'react-dom/server';
@@ -14,8 +13,9 @@ import ComponentDocs from './templates/ComponentDocs';
1413

1514
const dist = path.join(__dirname, 'dist');
1615

17-
del.sync(dist);
18-
fs.mkdirSync(dist);
16+
if (!fs.existsSync(dist)) {
17+
fs.mkdirSync(dist);
18+
}
1919

2020
const components = fs.readFileSync(path.join(__dirname, '../src/index.js'))
2121
.toString()

docs/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"babel-preset-es2015": "^6.18.0",
1818
"babel-preset-react": "^6.16.0",
1919
"babel-preset-stage-1": "^6.16.0",
20-
"del": "^2.2.2",
2120
"react-docgen": "^2.12.1"
2221
},
2322
"author": "",

src/components/Button.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Button extends PureComponent<void, Props, State> {
6262
*/
6363
primary: PropTypes.bool,
6464
/**
65-
* Text color of button, dark button will render ligh text and vice-versa
65+
* Text color of button, a dark button will render light text and vice-versa
6666
*/
6767
dark: PropTypes.bool,
6868
/**
@@ -74,7 +74,7 @@ class Button extends PureComponent<void, Props, State> {
7474
*/
7575
icon: PropTypes.string,
7676
/**
77-
* Custom text color for flat button or background color for raised button
77+
* Custom text color for flat button, or background color for raised button
7878
*/
7979
color: PropTypes.string,
8080
/**

0 commit comments

Comments
 (0)