File tree Expand file tree Collapse file tree 1 file changed +33
-20
lines changed Expand file tree Collapse file tree 1 file changed +33
-20
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 [$BUILD_CONTEXT ] for netlify"
4
5
5
6
yarn
6
7
yarn add gauge --ignore-workspace-root-check # netlify quirk
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
10
+ if [ " $BUILD_CONTEXT " = " DOCS" ]; then
28
11
12
+ echo " netlify-build docs"
13
+ pushd docs
14
+ yarn install
15
+ popd
16
+ yarn docs:build
17
+ mv docs/public netlify-build
18
+
19
+ elif [ " $BUILD_CONTEXT " = " CRA" ]; then
20
+
21
+ echo " netlify-build React examples"
22
+ pushd examples/cra-kitchen-sink
23
+ yarn add tapable # netlify quirk
24
+ yarn build-storybook
25
+ mv storybook-static ../../netlify-build
26
+ popd
27
+
28
+ elif [ " $BUILD_CONTEXT " = " VUE" ]; then
29
+
30
+ echo " netlify-build Vue examples"
31
+ pushd examples/vue-kitchen-sink
32
+ yarn build-storybook
33
+ mv storybook-static ../../netlify-build
34
+ popd
35
+
36
+ else
37
+ RED=' \033[0;31m'
38
+ NOCOLOR=' \033[0m'
39
+ echo " Unrecognized BUILD_CONTEXT \" ${RED} $BUILD_CONTEXT ${NOCOLOR} \" " 1>&2
40
+
41
+ fi
You can’t perform that action at this time.
0 commit comments