aboutsummaryrefslogtreecommitdiffstats
path: root/publish.sh
blob: aac78cf5f0905a61dcfff78a56aa3ee45d5259bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

rm .hugo_build.lock

# 执行 Hugo 构建和部署
commit_date=$(date +"%Y-%m-%d %H:%M:%S")
cd ~/blog/
hugo --cleanDestinationDir --gc --minify
cd ~/blog/public || exit 1
git add .
git commit -m "auto update: $commit_date"
git push origin main

echo "部署完成!"