feat: valid CICD
All checks were successful
/ build-and-deploy (push) Successful in 12s

This commit is contained in:
Sébastien Faguet 2026-05-07 17:03:42 +02:00
parent 136703f46d
commit c32dcb3bb6
5 changed files with 34 additions and 14 deletions

View file

@ -5,13 +5,14 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: koda-k8s runs-on: koda
env: env:
NAMESPACE: siwa-game-prd NAMESPACE: clem-siwa-game-prd
REGISTRY: siwa-game REGISTRY: clem-siwa-game
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 with:
lfs: true
- name: Helm lint charts - name: Helm lint charts
run: | run: |
@ -40,11 +41,10 @@ jobs:
| sed "s/namespace: servadmin/namespace: $NAMESPACE/" \ | sed "s/namespace: servadmin/namespace: $NAMESPACE/" \
| kubectl apply -f - | kubectl apply -f -
- name: Deploy with Helm - name: Deploy with Helm
run: | run: |
helm upgrade --install hugo charts \ helm upgrade --install hugo charts \
--namespace $NAMESPACE \ --namespace $NAMESPACE \
--set hugo.repository=$REGISTRY_URL/$REGISTRY/clem-hugo \ --set hugo.repository=$REGISTRY_URL/$REGISTRY/clem-hugo \
--set hugo.tag=${{ github.sha }} \ --set hugo.tag=${{ github.sha }} \
--set hugo.domain=preprod.siwa-game.fr --set "hugo.domains={www.siwa-game.fr,siwa-game.fr}"

View file

@ -1,9 +1,8 @@
FROM hugomods/hugo:latest AS builder FROM hugomods/hugo:latest AS builder
WORKDIR /app COPY ./src /src
COPY . . RUN hugo build
RUN cd src && hugo build FROM hugomods/hugo:nginx
FROM nginx:alpine COPY --from=builder /src/public /site
COPY --from=builder /app/src/public /usr/share/nginx/html

View file

@ -8,7 +8,8 @@ metadata:
traefik.ingress.kubernetes.io/router.tls.certresolver: le traefik.ingress.kubernetes.io/router.tls.certresolver: le
spec: spec:
rules: rules:
- host: "{{ .Values.hugo.domain }}" {{- range .Values.hugo.domains }}
- host: "{{ . }}"
http: http:
paths: paths:
- path: / - path: /
@ -18,3 +19,4 @@ spec:
name: hugo name: hugo
port: port:
number: 80 number: 80
{{- end }}

View file

@ -1,4 +1,4 @@
hugo: hugo:
domain: "" domains: []
repository: "" repository: ""
tag: "" tag: ""

19
docker-compose.yml Normal file
View file

@ -0,0 +1,19 @@
version: "3.7"
services:
clem-website:
build: .
restart: always
labels:
- traefik.enable=true
- traefik.docker.network=web
- traefik.http.routers.website_siwa.rule=Host(`siwa.deadpool.srv.obicorp.fr`) || Host(`www.siwa-game.fr`) || Host(`siwa-game.fr`)
- traefik.http.services.website_siwa.loadbalancer.server.port=80
- traefik.http.routers.website_siwa.entrypoints=websecure
- traefik.http.routers.website_siwa.tls=true
- traefik.http.routers.website_siwa.tls.certresolver=myresolver
networks:
- web
networks:
web:
external: true