File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 - cron : " 0 19 1,15 * *" # UTC 19:00 = 北京时间 03:00
77 # 支持手动触发
88 workflow_dispatch :
9+ inputs :
10+ force_renew :
11+ description : " 强制重新申请证书(添加新域名时使用)"
12+ required : false
13+ type : boolean
14+ default : false
915
1016env :
1117 DOMAINS : " xkcoding.com,www.xkcoding.com,blog.xkcoding.com"
3339 echo "🔐 检查 SSL 证书状态..."
3440 echo "📋 域名列表: $DOMAINS"
3541
42+ # 强制重新申请时删除旧证书
43+ FORCE_RENEW="${{ github.event.inputs.force_renew }}"
44+ if [ "$FORCE_RENEW" = "true" ] && [ -d "$CERT_PATH" ]; then
45+ echo "🗑️ 强制模式:删除旧证书..."
46+ rm -rf /opt/myblog/certbot/etc/live/xkcoding.com
47+ rm -rf /opt/myblog/certbot/etc/archive/xkcoding.com
48+ rm -rf /opt/myblog/certbot/etc/renewal/xkcoding.com.conf
49+ echo "✅ 旧证书已删除"
50+ fi
51+
3652 # 创建必要目录
3753 mkdir -p /opt/myblog/dist
3854 mkdir -p /opt/myblog/certbot/etc
You can’t perform that action at this time.
0 commit comments