File tree Expand file tree Collapse file tree 1 file changed +26
-22
lines changed Expand file tree Collapse file tree 1 file changed +26
-22
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- mkdir netlify-build
3
+ # Make sure to set $BUILD_CONTEXT in the Netlify "Deploy Settings"
4
+ echo " Building for Netlify. BUILD_CONTEXT: $BUILD_CONTEXT "
4
5
5
6
yarn
6
- yarn add gauge --ignore-workspace-root-check # netlify quirk
7
+ yarn add gauge --ignore-workspace-root-check # quirk with netlify build instance
7
8
yarn bootstrap --core
8
9
9
- echo " netlify-build docs"
10
- pushd docs
11
- yarn install
12
- popd
13
- yarn docs:build
14
- mv docs/public/* netlify-build/
15
-
16
- echo " netlify-build React examples"
17
- pushd examples/cra-kitchen-sink
18
- yarn add tapable # netlify quirk
19
- yarn build-storybook
20
- mv storybook-static ../../netlify-build/cra-kitchen-sink
21
- popd
22
-
23
- echo " netlify-build Vue examples"
24
- pushd examples/vue-kitchen-sink
25
- yarn build-storybook
26
- mv storybook-static ../../netlify-build/vue-kitchen-sink
27
- popd
28
-
10
+ if [ " $BUILD_CONTEXT " = " DOCS" ]; then
11
+ pushd docs
12
+ yarn install
13
+ popd
14
+ yarn docs:build
15
+ mv docs/public netlify-build
16
+ elif [ " $BUILD_CONTEXT " = " CRA" ]; then
17
+ pushd examples/cra-kitchen-sink
18
+ yarn add tapable # quirk with netlify build instance
19
+ yarn build-storybook
20
+ mv storybook-static ../../netlify-build
21
+ popd
22
+ elif [ " $BUILD_CONTEXT " = " VUE" ]; then
23
+ echo " netlify-build Vue examples"
24
+ pushd examples/vue-kitchen-sink
25
+ yarn build-storybook
26
+ mv storybook-static ../../netlify-build
27
+ popd
28
+ else
29
+ RED=' \033[0;31m'
30
+ NOCOLOR=' \033[0m'
31
+ echo " Unrecognized BUILD_CONTEXT \" ${RED} $BUILD_CONTEXT ${NOCOLOR} \" " 1>&2
32
+ fi
You can’t perform that action at this time.
0 commit comments