-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·35 lines (26 loc) · 907 Bytes
/
deploy.sh
File metadata and controls
executable file
·35 lines (26 loc) · 907 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
# For the maintainer having the necessary rights to publish from the local
# dev environment...
if [[ ! -d "site" ]]; then
echo -e "\033[31mError: 'site' folder does not exist. Aborting.\033[0m"
exit 1
fi
read -p "Are you sure you want to proceed? (y/n): " confirmation
if [[ "$confirmation" =~ ^[Yy]$ ]]; then
echo "Deploying..."
rm -rf deploy
mkdir deploy
cd deploy
git clone -b gh-pages git@github.com:Neoteroi/neoteroi.github.io.git copy
cp copy/CNAME ../site/
cp copy/README.md ../site/
find copy -mindepth 1 ! -name '.git' ! -name 'CNAME' ! -name 'README.md' ! -path 'copy/.git/*' -exec rm -rf {} +
cp -r ../site/* copy/
cd copy/
git add .
git commit -m "Deploy documentation on $(date -u '+%Y-%m-%d %H:%M:%S UTC')"
git push origin gh-pages --force
echo "Published to gh-pages"
else
echo "Operation canceled."
exit 1
fi