Trois surfaces partagent désormais le même design system, Tailwind v4
et React 19 — au lieu d'avoir landing en HTML vanilla, app en React, et
blog en Adonis SSR :
* packages/ui — design system partagé (tokens Tailwind v4 + composants
TSX) extrait depuis apps/web : Brand, Gem, Button, Card, Chip, Eyebrow,
EmptyState. apps/web migre 41 imports vers @rubis/ui.
* apps/landing — nouvelle app Astro 6 SSR (rubis.pro), remplace l'ancienne
landing nginx vanilla. Embarque :
- Landing complète portée en sections React (Hero, Stats, Promise,
HowItWorks, Gamification, Legal, Pricing, FAQ, FinalCTA, Footnotes)
- Pages légales (mentions, confidentialité, CGV) via LegalLayout.astro
- Blog SSR (/blog, /blog/:slug) qui consomme /api/v1/posts
- sitemap.xml, blog/rss.xml, robots.txt en endpoints Astro
- SEO complet (canonical, hreflang, OG, Twitter Card, JSON-LD
Article/BreadcrumbList/Blog/SoftwareApplication)
* apps/api — BlogController réduit à 2 endpoints JSON (GET /api/v1/posts
+ GET /api/v1/posts/:slug). Suppression des templates SSR Adonis
(apps/api/app/blog/), de l'alias #blog/*, des deps react-dom et
@types/react-dom. PostTransformer + PostSummaryTransformer ajoutés.
Le service blog_renderer + le seeder + les 3 articles fondateurs
restent intacts (réutilisés par futurs admin + cron IA).
* Infra :
- Dockerfile.landing (multi-stage Node 22 + tini, Astro standalone)
- k3s/app/landing.yml (Deployment + Service rubis-landing:4321 +
ConfigMap avec API_URL=http://rubis-api.rubis.svc.cluster.local:3333)
- .gitea/workflows/deploy.yml mis à jour pour build rubis-landing
- .gitea/workflows/deploy-web.yml + Dockerfile.web : prennent en
compte packages/ui/ comme dépendance
- Suppression du Dockerfile nginx legacy + k3s/{deployment,service}.yml
- Suppression de landing/ (assets favicons migrés vers
apps/landing/public/)
* Docs : architecture.md (vue d'ensemble + §4bis apps/landing complet,
§3 endpoints JSON blog, layout monorepo), CLAUDE.md (stack technique,
documents associés, déploiement).
Note infra : l'ancien Deployment "rubis" (nginx) et son Service ne sont
PAS supprimés par la CI — à nettoyer manuellement après validation que
Traefik a été repointé sur rubis-landing:4321 dans le repo proxmox.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
93 lines
3.1 KiB
YAML
93 lines
3.1 KiB
YAML
name: Build & Deploy Web
|
|
|
|
# Workflow Web (React/Vite + nginx) — sert app.rubis.pro.
|
|
# Reverse-proxie /api/* vers le service ClusterIP rubis-api.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'apps/web/**'
|
|
- 'packages/shared/**'
|
|
- 'packages/ui/**'
|
|
- 'pnpm-lock.yaml'
|
|
- 'pnpm-workspace.yaml'
|
|
- 'package.json'
|
|
- 'tsconfig.base.json'
|
|
- 'turbo.json'
|
|
- 'Dockerfile.web'
|
|
- 'k3s/app/web.yml'
|
|
- '.gitea/workflows/deploy-web.yml'
|
|
|
|
env:
|
|
REGISTRY: git.arthurbarre.fr
|
|
IMAGE: ordinarthur/rubis-web
|
|
NAMESPACE: rubis
|
|
DEPLOYMENT: rubis-web
|
|
CONTAINER: web
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ordinarthur
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push Web image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: Dockerfile.web
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
|
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:cache
|
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:cache,mode=max
|
|
# Vars Vite injectées dans le bundle au build time. Pour staging,
|
|
# créer un workflow séparé avec d'autres VITE_API_URL.
|
|
# Les VITE_SENTRY_* + SENTRY_* viennent des secrets CI Gitea
|
|
# (cf. README.md déploiement). Si SENTRY_AUTH_TOKEN est vide,
|
|
# le plugin Vite est skip et les sourcemaps ne sont pas uploadées.
|
|
build-args: |
|
|
VITE_API_URL=https://app.rubis.pro
|
|
VITE_PUBLIC_LANDING_URL=https://rubis.pro
|
|
VITE_USE_MOCKS=false
|
|
VITE_SENTRY_DSN_WEB=${{ secrets.SENTRY_DSN_WEB }}
|
|
VITE_APP_VERSION=${{ github.sha }}
|
|
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_ORG=${{ secrets.SENTRY_ORG }}
|
|
|
|
- name: Install kubectl
|
|
run: |
|
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
|
chmod +x kubectl
|
|
mv kubectl /usr/local/bin/
|
|
|
|
- name: Deploy to K3s
|
|
run: |
|
|
mkdir -p ~/.kube
|
|
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
|
|
chmod 600 ~/.kube/config
|
|
|
|
kubectl apply -f k3s/namespace.yml
|
|
|
|
kubectl -n $NAMESPACE create secret docker-registry gitea-registry \
|
|
--docker-server=$REGISTRY \
|
|
--docker-username=ordinarthur \
|
|
--docker-password=${{ secrets.REGISTRY_PASSWORD }} \
|
|
--dry-run=client -o yaml | kubectl apply -f -
|
|
|
|
kubectl apply -f k3s/app/web.yml
|
|
|
|
kubectl -n $NAMESPACE set image deployment/$DEPLOYMENT \
|
|
$CONTAINER=$REGISTRY/$IMAGE:${{ github.sha }}
|
|
|
|
kubectl -n $NAMESPACE rollout status deployment/$DEPLOYMENT --timeout=180s
|