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.
This commit is contained in:
parent
678ab326dd
commit
b154afcc7c
2 changed files with 63 additions and 1 deletions
62
.github/workflows/cd.yml
vendored
Normal file
62
.github/workflows/cd.yml
vendored
Normal file
|
|
@ -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"
|
||||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
# CI légère — P9 Street Vision PoC
|
# CI légère — P9 Street Vision PoC
|
||||||
# Même fichier lu par Forgejo Actions et GitHub Actions (OC-ADR-001).
|
# 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
|
name: CI
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue