-
Notifications
You must be signed in to change notification settings - Fork 1
/
github-deploy.sh
51 lines (41 loc) · 1.03 KB
/
github-deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
deployDirectory="deploy"
documentationPath="$deployDirectory/documentation"
remoteControllerPath="$deployDirectory/remote-controller"
{ # try
yarn --version > /dev/null 2> /dev/null && useYarn=1
} || { # catch
useYarn=0
}
# clean deploy folder
rm -rf $deployDirectory
mkdir $deployDirectory
# build documentation
mkdir $documentationPath
cd documentation-src
if [ $useYarn = 1 ]
then
yarn build-deploy
else
npm run build-deploy
fi
cd ..
# copy documentation build to deploy folder
cp -r documentation-src/public/ $documentationPath
# build katpat-remote
mkdir $remoteControllerPath
cd katpat-remote
if [ $useYarn = 1 ]
then
PUBLIC_URL=/katpat/remote-controller yarn build
else
PUBLIC_URL=/katpat/remote-controller npm run build
fi
cd ..
# copy katpat-remote build to deploy folder
cp -r katpat-remote/build/ $remoteControllerPath
# copy index.html for redirection in deploy folder
cp resources/index.html "$deployDirectory/index.html"
# deploy on github repo
documentation-src/node_modules/.bin/gh-pages -d deploy
echo "Done"