-
Notifications
You must be signed in to change notification settings - Fork 0
/
hugo_deploy.sh
52 lines (43 loc) · 1.05 KB
/
hugo_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
52
# GitHub A records
# 192.30.252.153
# 192.30.252.154
#!/bin/bash
#*
# rm -rf public
# git submodule add -b master https://github.com/taikii/whiteplain.git themes/whiteplain
# git submodule add -b master https://github.com/InTEGr8or/hugo_blackplain_theme.git themes/blackplain
# git clone https://gist.github.com/aad5b14b17276e803d352898a6c88c5b.git tmp
# mv hugo_deploy.sh .
# rm -rf tmp/
printf "\033[0;32mDeploying updates to GitHub...\033[0m"
# printf "Build the project."
# rmdir docs/** -r
rm -rf docs
printf "Building Hugo"
hugo
baseURL=$(cat config.toml | grep baseURL | awk '{print $3}' | tr -d \")
printf $baseURL > docs/CNAME
msg="rebuilding site `date`"
if [ $# -eq 1 ]
then msg="$1"
fi
# Go To layouts/
cd layouts
git add .
git commit -m "$msg"
git pull
git push
# return to parent folder
cd ..
# Add changes to git.
git add .
# Commit changes.
git commit -m "$msg"
git pull
# Push source and build repos.
git push # origin master -f
# Come Back up to the Project Root
# cd ..
printf "Task complete. You may close this window..."
# read
# open $baseURL