feat: restructure to kai-sa-cam layout with apps/ structure
CD — Kai-Sa-Cam Deployment / deploy (push) Canceled after 0s

This commit is contained in:
2026-10-25 01:06:31 +02:00
parent 95f939ef2d
commit 73394dfbbc
30 changed files with 6444 additions and 234 deletions
+33
View File
@@ -0,0 +1,33 @@
name: CD — Kai-Sa-Cam Deployment
on:
push:
branches: [main]
paths:
- "apps/kai-sa-cam/**"
- "config/kai-sa-go2rtc.yaml"
- "docker-compose.yml"
- "Makefile"
- ".github/workflows/deploy.yml"
workflow_dispatch:
concurrency:
group: deploy-kai-sa-cam
cancel-in-progress: false
jobs:
deploy:
runs-on: [self-hosted, kai-sa-cam]
steps:
- name: Fetch latest code and rebuild
env:
DEPLOY_DIR: ${{ secrets.DEPLOY_DIR }}
run: |
set -eu
dir="${DEPLOY_DIR:-/srv/apps/kai-sa-cam}"
git config --global --add safe.directory "$dir"
cd "$dir"
git pull --ff-only origin main
docker compose --profile prod build
docker compose --profile prod up -d
docker image prune -f
+52
View File
@@ -0,0 +1,52 @@
name: PR — Ouverture automatique (Kai-Sa-Cam)
on:
push:
branches-ignore: [main]
workflow_dispatch:
jobs:
create-pr:
runs-on: [self-hosted, kai-sa-cam]
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ouvrir (ou vérifier) la pull request
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API: ${{ github.server_url }}/api/v1
REPO: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
run: |
set -eu
if [ "$BRANCH" = "main" ]; then
echo "main est la base : aucune PR à ouvrir."
exit 0
fi
title=$(git log -1 --pretty=%s)
body=$(git log -1 --pretty=%b)
[ -n "$body" ] || body="PR automatique de $BRANCH vers main."
open=$(curl -fsS -H "Authorization: token $GITEA_TOKEN" \
"$API/repos/$REPO/pulls?state=open&limit=50" \
| python3 -c 'import json,os,sys; b=os.environ["BRANCH"]; print(sum(1 for p in json.load(sys.stdin) if p.get("head", {}).get("ref") == b))')
if [ "$open" -gt 0 ]; then
echo "Une PR est déjà ouverte pour $BRANCH."
exit 0
fi
python3 - "$BRANCH" "$title" "$body" <<'PY' | curl -fsS -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
--data-binary @- \
"$API/repos/$REPO/pulls"
import json, sys
branch, title, body = sys.argv[1], sys.argv[2], sys.argv[3]
print(json.dumps({"base": "main", "head": branch, "title": title, "body": body}))
PY
echo "PR créée."
+33
View File
@@ -0,0 +1,33 @@
name: Renovate (Kai-Sa-Cam)
on:
schedule:
- cron: "0 4 * * 1"
workflow_dispatch:
concurrency:
group: renovate-kai-sa-cam
cancel-in-progress: false
jobs:
renovate:
runs-on: [self-hosted, kai-sa-cam]
steps:
- name: Mettre à jour les dépendances
env:
RENOVATE_PLATFORM: gitea
RENOVATE_ENDPOINT: ${{ github.server_url }}
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
RENOVATE_REPOSITORIES: ${{ github.repository }}
run: |
set -eu
mkdir -p /srv/apps/kai-sa-cam/renovate-cache
docker run --rm \
-e RENOVATE_PLATFORM \
-e RENOVATE_ENDPOINT \
-e RENOVATE_TOKEN \
-e RENOVATE_REPOSITORIES \
-e RENOVATE_ONBOARDING=false \
-e LOG_LEVEL=info \
-v /srv/apps/kai-sa-cam/renovate-cache:/tmp/renovate \
ghcr.io/renovatebot/renovate:latest