diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index c57b91e..7779657 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -5,13 +5,14 @@ on: jobs: build-and-deploy: - runs-on: koda-k8s + runs-on: koda env: - NAMESPACE: siwa-game-prd - REGISTRY: siwa-game + NAMESPACE: clem-siwa-game-prd + REGISTRY: clem-siwa-game steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + lfs: true - name: Helm lint charts run: | @@ -40,11 +41,10 @@ jobs: | sed "s/namespace: servadmin/namespace: $NAMESPACE/" \ | kubectl apply -f - - - name: Deploy with Helm run: | helm upgrade --install hugo charts \ --namespace $NAMESPACE \ --set hugo.repository=$REGISTRY_URL/$REGISTRY/clem-hugo \ --set hugo.tag=${{ github.sha }} \ - --set hugo.domain=preprod.siwa-game.fr + --set "hugo.domains={www.siwa-game.fr,siwa-game.fr}" diff --git a/Dockerfile b/Dockerfile index 0114ce0..94bca70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ FROM hugomods/hugo:latest AS builder -WORKDIR /app -COPY . . +COPY ./src /src +RUN hugo build -RUN cd src && hugo build +FROM hugomods/hugo:nginx -FROM nginx:alpine -COPY --from=builder /app/src/public /usr/share/nginx/html +COPY --from=builder /src/public /site \ No newline at end of file diff --git a/charts/templates/ingress.yaml b/charts/templates/ingress.yaml index f7386cf..b9ad13d 100644 --- a/charts/templates/ingress.yaml +++ b/charts/templates/ingress.yaml @@ -8,7 +8,8 @@ metadata: traefik.ingress.kubernetes.io/router.tls.certresolver: le spec: rules: - - host: "{{ .Values.hugo.domain }}" + {{- range .Values.hugo.domains }} + - host: "{{ . }}" http: paths: - path: / @@ -18,3 +19,4 @@ spec: name: hugo port: number: 80 + {{- end }} diff --git a/charts/values.yaml b/charts/values.yaml index 41991c2..26b1264 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -1,4 +1,4 @@ hugo: - domain: "" + domains: [] repository: "" tag: "" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5f7ac8f --- /dev/null +++ b/docker-compose.yml @@ -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