UNPKG

1.34 kBapplication/x-shView Raw
1#!/bin/bash
2
3# IMPORTANT
4# ---------
5# This is an auto generated file with React CDK.
6# Do not modify this file.
7
8set -e # exit with nonzero exit code if anything fails
9
10# get GIT url
11
12GIT_URL=`git config --get remote.origin.url`
13if [[ $GIT_URL == "" ]]; then
14 echo "This project is not configured with a remote git repo".
15 exit 1
16fi
17
18# clear and re-create the out directory
19rm -rf .out || exit 0;
20mkdir .out;
21
22# run our compile script, discussed above
23build-storybook -o .out
24
25# go to the out directory and create a *new* Git repo
26cd .out
27git init
28
29# inside this git repo we'll pretend to be a new user
30git config user.name "GH Pages Bot"
31git 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".
35git add .
36git 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.
42git push --force --quiet $GIT_URL master:gh-pages > /dev/null 2>&1
43cd ..
44rm -rf .out
45
46echo ""
47echo "=> Storybook deployed to: `node .scripts/get_gh_pages_url.js $GIT_URL`"