.gitea/workflows/deploy.yml aktualisiert
This commit is contained in:
parent
c5be891b6a
commit
37854a62db
|
|
@ -1,28 +1,71 @@
|
||||||
name: Deploy (host runner, absolute actions)
|
name: Deploy Trainer_LLM to llm-node
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
paths:
|
||||||
|
- "knowledge/**"
|
||||||
|
- "llm-api/**"
|
||||||
|
- "scripts/**"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: deploy-trainer-llm
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: [ "linux_host" ] # muss zu den Runner-Labels passen
|
runs-on: linux_host # muss zum Runner-Label passen
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: https://gitea.com/actions/checkout@v4
|
# Absolute URL reduziert Abhängigkeit von DEFAULT_ACTIONS_URL
|
||||||
|
uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Sanity — Runner & Commit
|
||||||
uses: https://gitea.com/actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.12'
|
|
||||||
|
|
||||||
- name: Sync repository to /home/llmadmin
|
|
||||||
run: |
|
run: |
|
||||||
rsync -a --delete \
|
echo "Runner: $RUNNER_NAME Labels: $RUNNER_LABELS"
|
||||||
knowledge/ /home/llmadmin/knowledge/ \
|
echo "Commit: $GITEA_SHA Ref: $GITEA_REF"
|
||||||
llm-api/ /home/llmadmin/llm-api/ \
|
uname -a
|
||||||
scripts/ /home/llmadmin/scripts/
|
|
||||||
|
|
||||||
- name: Reload API (optional)
|
- name: Ensure target directories exist
|
||||||
run: |
|
run: |
|
||||||
sudo systemctl restart llm-api || true
|
mkdir -p /home/llmadmin/knowledge
|
||||||
|
mkdir -p /home/llmadmin/llm-api
|
||||||
|
mkdir -p /home/llmadmin/scripts
|
||||||
|
|
||||||
|
- name: Rsync knowledge/
|
||||||
|
if: ${{ hashFiles('knowledge/**') != '' }}
|
||||||
|
run: |
|
||||||
|
rsync -a --delete --exclude='.git' knowledge/ /home/llmadmin/knowledge/
|
||||||
|
echo "Synced knowledge/"
|
||||||
|
|
||||||
|
- name: Rsync llm-api/
|
||||||
|
if: ${{ hashFiles('llm-api/**') != '' }}
|
||||||
|
run: |
|
||||||
|
rsync -a --delete --exclude='.git' llm-api/ /home/llmadmin/llm-api/
|
||||||
|
echo "Synced llm-api/"
|
||||||
|
|
||||||
|
- name: Rsync scripts/
|
||||||
|
if: ${{ hashFiles('scripts/**') != '' }}
|
||||||
|
run: |
|
||||||
|
rsync -a --delete --exclude='.git' scripts/ /home/llmadmin/scripts/
|
||||||
|
echo "Synced scripts/"
|
||||||
|
|
||||||
|
- name: Optional — systemctl --user restart llm-api (ignore if missing)
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
XDG_RUNTIME_DIR: /run/user/${{ inputs.uid || 1000 }}
|
||||||
|
run: |
|
||||||
|
# Versuche nur zu restarten, wenn der Service existiert
|
||||||
|
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 — show latest changes
|
||||||
|
run: |
|
||||||
|
echo "Deploy complete. Listing targets:"
|
||||||
|
ls -la /home/llmadmin/knowledge | tail -n +1 || true
|
||||||
|
ls -la /home/llmadmin/llm-api | tail -n +1 || true
|
||||||
|
ls -la /home/llmadmin/scripts | tail -n +1 || true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user