forked from paulstatezny/decisive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·49 lines (37 loc) · 985 Bytes
/
Copy pathpublish.sh
File metadata and controls
executable file
·49 lines (37 loc) · 985 Bytes
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
#!/bin/bash
if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]
then
echo "Not on master. Exiting..."
exit 1
fi
# Build the JavaScript app
printf "\nBUILDING APP\n";
npm run build_production;
# Zip the built files
printf "\nBUNDLING FILES\n\n";
zip -r build build;
# Move built files to root directory
printf "\nCOMMITTING FILES TO gh-pages BRANCH\n\n";
git checkout gh-pages
rm -rf build/
unzip build
rm build.zip
# Move built files to root directory
ls | grep -v build | grep -v node_modules | grep -v .gitignore | xargs rm -rf;
mv build/* ./
rm -rf build/
if [ "$(git rev-parse --abbrev-ref HEAD)" != "gh-pages" ]
then
echo "Not on gh-pages branch. Exiting...";
git reset HEAD --hard;
git clean -f;
exit 1;
fi
# Push files to GitHub
git add -A
git commit --amend --no-edit
printf "\nSENDING TO GITHUB\n\n";
git push --force origin
printf "\nHEADED BACK TO MASTER\n\n";
git checkout master
printf "\nDONE\n\n";