Skip to content

Commit

Permalink
Only deploy Storybook if there are changes to client folder
Browse files Browse the repository at this point in the history
  • Loading branch information
julianguyen committed May 5, 2019
1 parent f7d5ad8 commit 514432e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ jobs:
name: Deploy Storybook
command: |
cd client
yarn build:storybook
mv .out .public
yarn run surge --project .public --domain design.if-me.org
yarn deploy:storybook
- save_cache:
key: v1-dep-{{ .Branch }}-{{ epoch }}
paths:
Expand Down
17 changes: 17 additions & 0 deletions client/.storybook/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if [[ "$PWD" != */client ]]; then
cd client || exit
fi

CHANGES_IN_CLIENT=$(git diff)

if [[ "$CHANGES_IN_CLIENT" ]]; then
echo "Deploy changes to design.if-me.org"
yarn build:storybook
mv .out .public
yarn run surge --project .public --domain design.if-me.org
else
echo "No changes to deploy to design.if-me.org"
exit
fi
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"storybook": "yarn build:i18n && start-storybook -p 6006",
"test": "yarn build:i18n && yarn build:test && NODE_PATH=./app jest",
"test:debug": "yarn build:i18n && yarn build:test && NODE_PATH=./app node --inspect-brk jest --runInBand",
"test:circleci": "yarn build:test && NODE_PATH=./app jest --coverage --runInBand"
"test:circleci": "yarn build:test && NODE_PATH=./app jest --coverage --runInBand",
"deploy:storybook": "chmod +x ./.storybook/deploy.sh && ./.storybook/deploy.sh"
},
"cacheDirectories": [
"node_modules",
Expand Down

0 comments on commit 514432e

Please sign in to comment.