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

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

echo "部署完成!"