All checks were successful
Deploy Trainer_LLM to llm-node / deploy (push) Successful in 1s
73 lines
2.4 KiB
YAML
73 lines
2.4 KiB
YAML
name: Deploy Trainer_LLM to llm-node
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
# Kein paths-Filter mehr: neue Ordner deployen sofort mit, sobald sie in DEPLOY_DIRS stehen.
|
|
|
|
concurrency:
|
|
group: deploy-trainer-llm
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: linux_host
|
|
env:
|
|
# -> Hier trägst du ALLE zu deployenden Top-Level-Verzeichnisse ein:
|
|
# Bei neuen Ordnern einfach anhängen (durch Leerzeichen getrennt)
|
|
DEPLOY_DIRS: "knowledge llm-api scripts schemas"
|
|
TARGET_BASE: "/home/llmadmin"
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Sanity — Runner & Commit
|
|
run: |
|
|
echo "Runner: $RUNNER_NAME Labels: $RUNNER_LABELS"
|
|
echo "Commit: ${GITHUB_SHA:-$GITEA_SHA} Ref: ${GITHUB_REF:-$GITEA_REF}"
|
|
uname -a
|
|
|
|
- name: Ensure target base exists
|
|
run: |
|
|
install -d "$TARGET_BASE"
|
|
|
|
- name: Deploy whitelisted directories
|
|
run: |
|
|
set -euo pipefail
|
|
IFS=' ' read -r -a DIRS <<< "$DEPLOY_DIRS"
|
|
|
|
for d in "${DIRS[@]}"; do
|
|
if [ -d "$d" ]; then
|
|
# Nur wenn im Ordner auch Dateien/Unterordner liegen
|
|
if [ -n "$(find "$d" -mindepth 1 -print -quit)" ]; then
|
|
echo ">> Syncing $d -> $TARGET_BASE/$d"
|
|
install -d "$TARGET_BASE/$d"
|
|
rsync -a --delete \
|
|
--exclude='.git' \
|
|
--exclude='.env' --exclude='.env.*' --exclude='**/.env' --exclude='**/.env.*' \
|
|
"$d"/ "$TARGET_BASE/$d"/
|
|
else
|
|
echo ">> Skipping $d (leer)"
|
|
fi
|
|
else
|
|
echo ">> Skipping $d (existiert nicht im Repo)"
|
|
fi
|
|
done
|
|
|
|
- name: Optional — systemctl --user restart llm-api (ignore if missing)
|
|
continue-on-error: true
|
|
run: |
|
|
if systemctl --user list-unit-files | grep -q '^llm-api.service'; then
|
|
systemctl --user restart llm-api.service
|
|
systemctl --user --no-pager status llm-api.service --full -l || true
|
|
else
|
|
echo "llm-api.service nicht gefunden — Schritt wird übersprungen."
|
|
fi
|
|
|
|
- name: Post-check — list targets
|
|
run: |
|
|
for d in $DEPLOY_DIRS; do
|
|
echo "== $TARGET_BASE/$d =="
|
|
ls -la "$TARGET_BASE/$d" 2>/dev/null | tail -n +1 || true
|
|
done
|