From b154afcc7c5c664b87648633e8c37bbd1654e42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Mureau?= Date: Wed, 9 Sep 2026 21:10:09 +0200 Subject: [PATCH] Ajouter le CD P9 : build/push vers le registry OCI Forgejo. Image PyTorch plus lourde que P7/P8 ; le job peut OOM sur DinD 8 Gio. --- .github/workflows/cd.yml | 62 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..f3074cc --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,62 @@ +# CD — build/push image vers le registry OCI Forgejo (OC-ADR-006). +# PyTorch 2.8 : plus lourd que P7/P8 (TF). DinD limité à 8 Gio — OOM possible. + +name: CD + +on: + push: + branches: [main] + paths: + - "Dockerfile" + - "app/**" + - "utils/**" + - "start.sh" + - "nginx.conf" + - "cityscapes_config.json" + - ".github/workflows/cd.yml" + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + build-and-push: + if: contains(github.server_url, 'gregoiremureau.com') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker CLI (client only) + daemon DinD + run: | + set -eu + apt-get update + apt-get install -y --no-install-recommends ca-certificates curl + curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz \ + | tar -xz -C /tmp + install /tmp/docker/docker /usr/local/bin/docker + docker version + docker info + + - name: Login registry Forgejo + run: | + set -eu + REGISTRY="${GITHUB_SERVER_URL#https://}" + echo "${{ secrets.PACKAGE_TOKEN }}" | docker login "${REGISTRY}" -u "${GITHUB_ACTOR}" --password-stdin + + - name: Build and push + run: | + set -eu + REGISTRY="${GITHUB_SERVER_URL#https://}" + IMAGE="${REGISTRY}/grgmro/oc-p09-street-vision-poc" + SHORT_SHA="$(echo "${GITHUB_SHA}" | cut -c1-12)" + export DOCKER_BUILDKIT=0 + docker build \ + -t "${IMAGE}:${SHORT_SHA}" \ + -t "${IMAGE}:latest" \ + -f Dockerfile \ + . + docker push "${IMAGE}:${SHORT_SHA}" + docker push "${IMAGE}:latest" + echo "pushed ${IMAGE}:${SHORT_SHA} and :latest" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b78ea0d..85bbaa9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ # CI légère — P9 Street Vision PoC # Même fichier lu par Forgejo Actions et GitHub Actions (OC-ADR-001). -# Le build Docker (2 modèles) est Phase 6 : trop lourd pour le runner k3s (8 Gio). +# Le build Docker est `.github/workflows/cd.yml` (registry Forgejo). Image PyTorch : risque OOM DinD 8 Gio. name: CI