Files
action-sandbox/deploy.sh
nan d2425dc2be feat: restructure wiki and notes, enhance Viewer component
- Removed obsolete theme index and documentation files.
- Deleted unused images and canvas files.
- Added new images for notes and updated canvas files.
- Enhanced Viewer component with improved zoom and fullscreen functionalities.
- Updated wiki configuration with new navigation and sidebar structure.
- Created new index pages for notes and wiki with categorized content.
- Updated links and references in markdown files to reflect new structure.
2026-04-22 12:02:32 +08:00

36 lines
971 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 检查 wiki 目录是否有变更
CHANGED_FILES=$(git diff --name-only wiki && git ls-files --others --exclude-standard wiki)
if [ -n "$CHANGED_FILES" ]; then
echo "检测到 wiki 目录有变更,正在提交..."
git add wiki
git commit -m "Update wiki"
else
echo "wiki 目录没有变更,跳过提交"
fi
# 自动获取当前 Git 分支名
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
# 获取仓库名称
REMOTE_URL=$(git remote get-url origin)
REPO_NAME=$(basename -s .git "$REMOTE_URL")
# 拼接 Tag 名称:wiki-分支名
TAG_NAME="wiki-$BRANCH_NAME"
echo "当前分支:$BRANCH_NAME"
# 创建本地 Tag
git tag -f "$TAG_NAME"
# 推送到远程仓库
if git push origin -f "$TAG_NAME"; then
echo -e "\n✅ $BRANCH_NAME 创建并推送成功,等待部署完毕"
echo -e "\n🌍 部署地址:https://wiki.omoolab.com/$REPO_NAME/$BRANCH_NAME/"
else
echo -e "\n❌ $BRANCH_NAME 推送失败!"
exit 1
fi