-
Notifications
You must be signed in to change notification settings - Fork 0
/
depoly.sh
executable file
·57 lines (45 loc) · 1.11 KB
/
depoly.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
53
54
55
56
57
#!/bin/bash
# 执行 git pull
echo "Pulling latest changes from the repository..."
git pull
# 检查是否拉取成功
if [ $? -ne 0 ]; then
echo "Failed to pull latest changes. Aborting."
exit 1
fi
# 执行 /template/pages/generate.sh
echo "Generating pages..."
bash /template/pages/generate.sh
# 检查 generate.sh 是否执行成功
if [ $? -ne 0 ]; then
echo "Failed to generate pages. Aborting."
exit 1
fi
# 执行 /template/index/generate.sh
echo "Generating index..."
bash /template/index/generate.sh
# 检查 generate.sh 是否执行成功
if [ $? -ne 0 ]; then
echo "Failed to generate index. Aborting."
exit 1
fi
# 将更改添加到 Git
echo "Adding changes to Git..."
git add .
# 提交更改
echo "Committing changes..."
git commit -m "deploy pages"
# 检查提交是否成功
if [ $? -ne 0 ]; then
echo "Failed to commit changes. Aborting."
exit 1
fi
# 推送到 GitHub
echo "Pushing changes to GitHub..."
git push
# 检查推送是否成功
if [ $? -ne 0 ]; then
echo "Failed to push changes to GitHub. Aborting."
exit 1
fi
echo "Deployment completed successfully!"