Files
ci-ai/.gitea/workflows/cd.yml
Tarik Moussa 5317e40fe7 chore: interne Host-Adresse durch generischen Hostnamen ersetzt
Ersetzt die private LAN-IP des Jetson durch jetson.local in Doku,
Beispiel-Workflows und als Default in scripts/llm.py. Betrifft nur
Fallback-Werte -- die Org-Variable JETSON_OLLAMA_URL bzw. AI_BASE_URL
hat weiterhin Vorrang.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-31 00:35:23 +02:00

47 lines
1.6 KiB
YAML

# CD — rebuild and restart ci-ai-bot on the Pi whenever bot/ or scripts/ change.
#
# How it works (Docker-out-of-Docker):
# 1. Job runs in docker:cli on the Pi runner (eulernest label).
# 2. Mounts the HOST docker socket → builds the new image directly in the host
# Docker daemon (no registry push needed — image is already local).
# 3. Mounts /mnt/external:ro → runs `docker compose up --force-recreate`
# which picks up the freshly built image and recreates the container.
#
# Prerequisite (one-time):
# - Runner config must list /var/run/docker.sock and /mnt/external in valid_volumes
# (set in ansible-eulernest roles/gitea_runner/templates/config.yaml.j2).
# - Set org variable JETSON_OLLAMA_URL in conformallab → Actions → Variables:
# value = http://jetson.local:11434/v1
name: CD — ci-ai-bot
on:
push:
branches: [main]
paths:
- "bot/**"
- "scripts/**"
jobs:
deploy:
runs-on: eulernest
container:
image: docker:27-cli
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /mnt/external:/mnt/external:ro
steps:
- uses: actions/checkout@v4
- name: Build ci-ai-bot image
# Build from repo root so bot/Dockerfile can COPY scripts/
run: docker build -t ci-ai-bot:latest -f bot/Dockerfile .
- name: Recreate ci-ai-bot container
# --force-recreate: always replace the container even if config is unchanged,
# so the freshly built image is picked up.
run: |
docker compose \
-f /mnt/external/docker-compose.yml \
up -d --no-deps --force-recreate ci-ai-bot