Skip to content

Commit 4b9e74b

Browse files
authored
Merge pull request #1047 from swagger-api/gh-pages-script
Make deploy to gh-pages a shell script
2 parents 0d32a21 + a08d04e commit 4b9e74b

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

gh-pages.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'#!/bin/bash'
2+
3+
echo 'checkout master'
4+
git checkout master
5+
6+
echo 'pull origin master'
7+
git pull origin master
8+
9+
echo '>> rm -rf node_modules'
10+
rm -rf node_modules
11+
12+
echo '>> npm install'
13+
npm install
14+
15+
echo '>> git checkout gh-pages'
16+
git checkout gh-pages
17+
18+
echo '>> git merge --no-edit --no-ff origin/master'
19+
git merge --no-edit --no-ff origin/master
20+
21+
echo '>> npm run build'
22+
npm run build
23+
24+
echo '>> git add -A'
25+
git add -A
26+
27+
echo '>> git commit -m "Update from master at $(git rev-parse --short master)"'
28+
git commit -m "Update from master at $(git rev-parse --short master)"
29+
30+
echo '>> npm test'
31+
npm test
32+
33+
echo '>> git push origin gh-pages'
34+
git push origin gh-pages
35+
36+
echo '>> git checkout -'
37+
git checkout -
38+
39+
echo 'deployed to gh-pages'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@
110110
"e2e-test": "protractor test/e2e/protractor.config.js",
111111
"test": "npm run unit-test && npm run e2e-test",
112112
"lint": "eslint . --format 'node_modules/eslint-friendly-formatter'",
113-
"gh-pages": "git checkout gh-pages && git merge --no-edit --no-ff origin/master && npm run build && git commit -a -m \"Update from master at $(git rev-parse --short master)\" && git push origin gh-pages && git checkout -"
113+
"gh-pages": "./gh-pages.sh"
114114
}
115115
}

0 commit comments

Comments
 (0)