mindnet/.gitea/workflows/deploy.yml
Lars 4a9d8ed501
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s
.gitea/workflows/deploy.yml aktualisiert
2025-09-03 12:30:04 +02:00

51 lines
1.7 KiB
YAML
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.

# .gitea/workflows/deploy.yml
name: Deploy mindnet to llm-node
on: { push: { branches: [ "main" ] } }
# on: {}
concurrency: { group: deploy-mindnet, cancel-in-progress: false }
jobs:
deploy:
runs-on: linux_host
env:
DEPLOY_DIRS: "app scripts schemas docker requirements.txt README.md"
TARGET_BASE: "/home/llmadmin/mindnet"
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Ensure target base
run: install -d "$TARGET_BASE"
- name: Deploy whitelisted
run: |
set -euo pipefail
IFS=' ' read -r -a DIRS <<< "$DEPLOY_DIRS"
for d in "${DIRS[@]}"; do
if [ -e "$d" ]; then
if [ -d "$d" ]; then
install -d "$TARGET_BASE/$d"
rsync -a --delete --exclude='.git' \
--exclude='.env' --exclude='.env.*' --exclude='**/.env*' \
"$d"/ "$TARGET_BASE/$d"/
else
rsync -a "$d" "$TARGET_BASE/$d"
fi
fi
done
- name: Python venv (idempotent)
run: |
cd "$TARGET_BASE"
[ -d .venv ] || python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
[ -f requirements.txt ] && pip install -r requirements.txt || true
- name: Optional — restart mindnet-api
continue-on-error: true
run: |
if systemctl --user list-unit-files | grep -q '^mindnet-api.service'; then
systemctl --user restart mindnet-api.service
systemctl --user --no-pager status mindnet-api.service --full -l || true
else
echo "mindnet-api.service nicht vorhanden übersprungen."
fi