Skip to content

Commit

Permalink
feat(update_site.sh): Add Clash network management during site deploy…
Browse files Browse the repository at this point in the history
…ment

- Added `clashon` before repository cloning
- Added `clashoff` after successful deployment
- Ensures proper network configuration during site update process
  • Loading branch information
W1ndys committed Feb 12, 2025
1 parent 9854184 commit 38911f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions update_site_scripts/update_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ log() {
rm -rf "$WORK_DIR" && \
mkdir -p "$WORK_DIR" && \

# 开启clash
clashon

# 尝试通过 SSH 克隆仓库
log "尝试通过 SSH 克隆仓库: $REPO_URL"
if ! git clone --depth 1 -b gh-pages "$REPO_URL" "$WORK_DIR"; then
Expand Down Expand Up @@ -47,6 +50,10 @@ log() {

log "部署完成"
# 如果所有命令成功执行,调用Python脚本报告成功

# 关闭clash
clashoff

python3 update_site.py --status success
} || {
# 如果有任何命令失败,调用Python脚本报告错误
Expand Down

0 comments on commit 38911f5

Please sign in to comment.