Files
Talks/.gitea/workflows/build-and-push.yaml
T
Le Prévost-Corvellec Arnault c004da7b20
Talks slides — image & chart / vars (push) Successful in 2s
Talks slides — image & chart / Helm chart (push) Successful in 8s
Talks slides — image & chart / Build container image (push) Successful in 1m12s
Update image repository references in build-and-push workflow and values.yaml
- Changed the IMAGE_NAME and HELM_OCI_REPOSITORY in build-and-push.yaml to reflect the new repository structure.
- Updated the image repository path in values.yaml to align with the new naming convention for the talks-slides project.
2026-05-01 02:01:34 +02:00

129 lines
4.2 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.
name: Talks slides — image & chart
# Build image + chart quand le site statique (portail, decks, toolchain) ou l’infra change.
on:
push:
branches: [main, master, develop, cicd]
tags: ['v*']
paths:
- 'server/**'
- 'talks-slides-dist/**'
- '.gitea/workflows/**'
- 'portal/**'
- 'slides/**'
- 'tools/**'
- 'package.json'
- 'package-lock.json'
- '.dockerignore'
pull_request:
branches: [main, master, develop]
paths:
- 'server/**'
- 'talks-slides-dist/**'
- '.gitea/workflows/**'
- 'portal/**'
- 'slides/**'
- 'tools/**'
- 'package.json'
- 'package-lock.json'
- '.dockerignore'
env:
# GIT_DEFAULT_HASH: sha256
DOCKER_HOST: 'unix:///var/run/docker.sock'
DOCKER_CERT_PATH: '/certs/client'
IMAGE_REGISTRY: git.specificat.io
IMAGE_NAME: arnault/talks-slides
# Même registre OCI Helm que les autres charts (ex. knowledge-mcp).
HELM_OCI_REPOSITORY: oci://git.specificat.io/arnault
HELM_DIR: ./talks-slides-dist
jobs:
vars:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.out.outputs.version }}
steps:
- id: out
env:
RUN_NUMBER: ${{ github.run_number }}
REF_NAME: ${{ github.ref_name }}
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "version=${REF_NAME#v}" >> $GITHUB_OUTPUT
else
echo "version=0.0.${RUN_NUMBER}" >> $GITHUB_OUTPUT
fi
build-image:
runs-on: ubuntu-latest
name: Build container image
needs: vars
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: github.event_name == 'push'
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ secrets.CI_USER }}
password: ${{ secrets.CI_TOKEN }}
- name: Build and push image
if: github.event_name == 'push'
env:
VERSION: ${{ needs.vars.outputs.version }}
run: |
set -euo pipefail
IMAGE="${IMAGE_REGISTRY}/${IMAGE_NAME}:${VERSION}"
docker build -f server/Dockerfile -t "${IMAGE}" .
docker push "${IMAGE}"
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
docker tag "${IMAGE}" "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest"
docker push "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest"
fi
- name: Build image (PR, no push)
if: github.event_name == 'pull_request'
run: |
set -euo pipefail
docker build -f server/Dockerfile -t talks-slides:ci .
helm:
runs-on: ubuntu-latest
name: Helm chart
needs: vars
steps:
- uses: actions/checkout@v4
- name: Install Helm
run: |
set -euo pipefail
curl -fsSL -o helm.tgz --user "${{ secrets.CI_USER }}:${{ secrets.CI_TOKEN }}" \
"https://git.specificat.io/api/packages/arnault/generic/helm/4.1.1/helm-v4.1.1-linux-amd64.tar.gz"
tar -xzf helm.tgz
sudo mv linux-amd64/helm /usr/local/bin/helm
helm version
# Chart publié avec le même tag que l’image (évite latest / oubli de --set au déploiement).
- name: Aligner slides.image.tag sur la version build
env:
VERSION: ${{ needs.vars.outputs.version }}
run: |
set -euo pipefail
f="${HELM_DIR}/values.yaml"
sed -i 's|^ tag: ".*"| tag: "'"${VERSION}"'"|' "$f"
grep -E '^ tag:' "$f" || true
- name: Helm lint & template
run: |
set -euo pipefail
helm lint "${HELM_DIR}"
helm template talks-slides "${HELM_DIR}"
- name: Package and push chart (OCI)
if: github.event_name == 'push'
env:
VERSION: ${{ needs.vars.outputs.version }}
run: |
set -euo pipefail
helm package "${HELM_DIR}" --version "${VERSION}" --app-version "${VERSION}"
helm registry login "${IMAGE_REGISTRY}" -u "${{ secrets.CI_USER }}" -p "${{ secrets.CI_TOKEN }}"
helm push "talks-slides-chart-${VERSION}.tgz" "${HELM_OCI_REPOSITORY}"