- 改用 rsync 同步技能到全局目录 - 支持多代理共享技能 - 使用 --delete 保持同步干净
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Deploy to knowledge-base
|
name: Deploy kb-skills
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,12 +9,40 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
steps:
|
steps:
|
||||||
- name: Sync to knowledge-base workspace
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
cd /home/starmen1265/.openclaw/agents/knowledge-base/workspace/skills
|
git clone --depth 1 ssh://gitea-nas/starmen1265/kb-skills.git /tmp/kb-skills-deploy
|
||||||
# 确保使用 SSH config 别名
|
|
||||||
git remote set-url origin ssh://gitea-nas/starmen1265/kb-skills.git
|
- name: Sync to global skills directory
|
||||||
git fetch origin
|
run: |
|
||||||
# 强制重置到远程状态,避免未跟踪文件冲突
|
SKILLS_DIR="/home/starmen1265/.openclaw/skills"
|
||||||
git reset --hard origin/main
|
SRC_DIR="/tmp/kb-skills-deploy"
|
||||||
echo "✅ Deployed at $(date)"
|
|
||||||
|
# 技能列表
|
||||||
|
SKILLS=(
|
||||||
|
"dev-workflow"
|
||||||
|
"kb-bilibili-content"
|
||||||
|
"kb-bilibili-metadata"
|
||||||
|
"kb-deep-analyzer"
|
||||||
|
"kb-funasr"
|
||||||
|
"kb-link-parser"
|
||||||
|
"kb-ocr-processor"
|
||||||
|
"kb-whisper"
|
||||||
|
"kb-whisper-diarization"
|
||||||
|
"kb-workflow"
|
||||||
|
"kb-zhihu-content"
|
||||||
|
"kb-zhihu-metadata"
|
||||||
|
"todo-manager"
|
||||||
|
)
|
||||||
|
|
||||||
|
for skill in "${SKILLS[@]}"; do
|
||||||
|
if [ -d "$SRC_DIR/$skill" ]; then
|
||||||
|
rsync -av --delete "$SRC_DIR/$skill/" "$SKILLS_DIR/$skill/"
|
||||||
|
echo "✅ Synced: $skill"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "🎉 Deployed at $(date)"
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
run: rm -rf /tmp/kb-skills-deploy
|
||||||
|
|||||||
Reference in New Issue
Block a user