1 |
|
2 |
|
3 | # IMPORTANT
|
4 | # ---------
|
5 | # This is an auto generated file with React CDK.
|
6 | # Do not modify this file.
|
7 |
|
8 | set -e # exit with nonzero exit code if anything fails
|
9 |
|
10 | # get GIT url
|
11 |
|
12 | GIT_URL=`git config --get remote.origin.url`
|
13 | if [[ $GIT_URL == "" ]]; then
|
14 | echo "This project is not configured with a remote git repo".
|
15 | exit 1
|
16 | fi
|
17 |
|
18 | # clear and re-create the out directory
|
19 | rm -rf .out || exit 0;
|
20 | mkdir .out;
|
21 |
|
22 | # run our compile script, discussed above
|
23 | build-storybook -o .out
|
24 |
|
25 | # go to the out directory and create a *new* Git repo
|
26 | cd .out
|
27 | git init
|
28 |
|
29 | # inside this git repo we'll pretend to be a new user
|
30 | git config user.name "GH Pages Bot"
|
31 | git config user.email "hello@ghbot.com"
|
32 |
|
33 | # The first and only commit to this new Git repo contains all the
|
34 | # files present with the commit message "Deploy to GitHub Pages".
|
35 | git add .
|
36 | git commit -m "Deploy Storybook to GitHub Pages"
|
37 |
|
38 | # Force push from the current repo's master branch to the remote
|
39 | # repo's gh-pages branch. (All previous history on the gh-pages branch
|
40 | # will be lost, since we are overwriting it.) We redirect any output to
|
41 | # /dev/null to hide any sensitive credential data that might otherwise be exposed.
|
42 | git push --force --quiet $GIT_URL master:gh-pages > /dev/null 2>&1
|
43 | cd ..
|
44 | rm -rf .out
|
45 |
|
46 | echo ""
|
47 | echo "=> Storybook deployed to: `node .scripts/get_gh_pages_url.js $GIT_URL`"
|