File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ function get_tmp {
55 echo " .` cat /dev/urandom | env LC_CTYPE=C tr -dc a-z0-9 | head -c 16` "
66}
77
8+ echo " Running deploy..."
9+
810SRC_URL=' git@github.com:frontendu/frontendu.github.io'
911NPM_VERSION=$1
1012TMP_PATH=` get_tmp`
@@ -14,28 +16,39 @@ if [ -z $NPM_VERSION ]; then
1416 NPM_VERSION=' patch'
1517fi
1618
19+ echo " Incrementing version to ${NPM_VERSION} ..."
20+
1721npm version $NPM_VERSION -m " Version bumped to %s"
1822
19- git push origin dev
20- git push --tags
23+ echo " Pushing version and tags..."
24+
25+ git push origin dev -q
26+ git push --tags -q
2127
2228SITE_VERSION=` node -e "
2329 console.log(require('./package.json').version)
2430" `
2531
26- npm run build:prod
32+ echo " Builing site... "
2733
28- git clone $SRC_URL $TMP_PATH
29- cd $TMP_PATH ;
30- git checkout master
34+ npm run build:prod -- --silent
3135
32- git rm -r ./
36+ echo " Prepare for publishing site..."
37+
38+ git clone $SRC_URL $TMP_PATH -q
39+ cd $TMP_PATH > /dev/null;
40+ git checkout master -q
41+ git rm -r ./ -q
42+
43+ echo " Copying new content of site..."
3344
3445cp -r ../$DIST_PATH /* ./
35- git add -A
46+ git add -A -q
47+
48+ echo " Publishing site..."
3649
3750git commit -m " Version of site bumped to ${SITE_VERSION} " || rm -rf $TMP_PATH
3851
39- git push origin master
52+ git push origin master -q
4053
4154rm -rf $TMP_PATH
You can’t perform that action at this time.
0 commit comments