forked from studyathome-internationally/hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-studyathome.sh
40 lines (38 loc) · 1.37 KB
/
publish-studyathome.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
#!/bin/bash
BASEPATH="/"
DOMAIN="hub.studyathome.technikum-wien.at"
if [[ -z "$1" ]] ; then
rm -rf build/
mkdir gh-pages
BASE=$BASEPATH yarn build
mv gh-pages/next next-backup
rm -rf gh-pages/*
cp -r build/* gh-pages/
mv next-backup gh-pages/next
cd gh-pages/
echo $DOMAIN > CNAME
cd ..
# git add .
# git commit -m "docs: release hub"
# git push
scp -r gh-pages/* [email protected]:/var/www/html/hub-public/
# the subfolders must have the r and x permission set in order to be accessible by the webserver. This should already be set correctly
# ssh [email protected] chmod -R 755 /var/www/html/hub-public/
else
if [[ "$1" == "next" ]] ; then
rm -rf build/
mkdir gh-pages
BASE=$BASEPATH"next/" yarn build
rm -rf gh-pages/next
cp -r build gh-pages/next
cd gh-pages/next
echo $DOMAIN > CNAME
cd ../..
# git add .
# git commit -m "docs: release hub"
# git push
scp -r gh-pages/* [email protected]:/var/www/html/hub-public/
# the subfolders must have the r and x permission set in order to be accessible by the webserver. This should already be set correctly
# ssh [email protected] chmod -R 755 /var/www/html/hub-public/
fi
fi