-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·46 lines (39 loc) · 1.02 KB
/
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
#!/bin/sh
###
# @Author: summer [email protected]
# @Date: 2022-05-19 19:42:35
# @LastEditors: summer [email protected]
# @LastEditTime: 2022-05-19 19:42:52
# @FilePath: /Summer_Tec_Blog/deploy.sh
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
# If a command fails then the deploy stops
# set -e
printf "\033[0;32mDeploying updates to GitHub...\033[0m\n"
# Create commit message
msg="rebuilding site $(date)"
if [ -n "$*" ]; then
msg="$*"
fi
# Build the project.
echo ""
echo ""
echo "Committing changes to $(pwd)"
hugo -D
# Go To Public folder
cd public
# Add 'public' (Github Pages repo) changes to git and commit/push.
echo ""
echo ""
echo "Committing changes to $(pwd)"
git add .
git commit -m "$msg"
git push
# Add this repos changes to git and commit/push. First 'cd' out of public
cd ..
echo ""
echo ""
echo "Committing changes to $(pwd)"
git add .
git commit -m "$msg"
git push