Déploiement - ProbatioVault Site¶
CI/CD GitLab et mise en production
Vue d'ensemble¶
Le site est déployé automatiquement sur GitLab Pages à chaque push sur la branche main.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Push │────▶│ GitLab CI │────▶│ GitLab Pages │
│ main │ │ npm build │ │ public/ │
└──────────────┘ └──────────────┘ └──────────────┘
│
▼
┌──────────────────────┐
│ probatiovault.com │
│ (OVH DNS CNAME) │
└──────────────────────┘
Pipeline CI/CD¶
Configuration (.gitlab-ci.yml)¶
image: node:20
cache:
paths:
- node_modules/
pages:
stage: deploy
script:
- npm ci
- npm run build
- rm -rf public
- mv dist public
artifacts:
paths:
- public
only:
- main
Étapes du pipeline¶
| Étape | Commande | Description |
|---|---|---|
| 1 | npm ci | Installation dépendances (lockfile) |
| 2 | npm run build | Build Astro → dist/ |
| 3 | rm -rf public | Suppression ancien build |
| 4 | mv dist public | Renommage pour GitLab Pages |
Artefacts¶
Configuration DNS¶
OVH (via Terraform)¶
Le DNS est géré dans ProbatioVault-infra/terraform/ :
# dns.tf
resource "ovh_domain_zone_record" "site_cname" {
zone = "probatiovault.com"
subdomain = ""
fieldtype = "CNAME"
target = "probatiovault.gitlab.io."
ttl = 3600
}
resource "ovh_domain_zone_record" "site_txt_verification" {
zone = "probatiovault.com"
subdomain = "_gitlab-pages-verification"
fieldtype = "TXT"
target = "gitlab-pages-verification=..."
ttl = 3600
}
Vérification DNS¶
SSL/TLS¶
Let's Encrypt (automatique)¶
GitLab Pages gère automatiquement :
- Génération certificat Let's Encrypt
- Renouvellement automatique (90 jours)
- Redirection HTTP → HTTPS
Configuration GitLab Pages¶
Dans Settings > Pages :
- Force HTTPS
- Use unique domain
- Custom domain:
probatiovault.com
Développement local¶
Prérequis¶
- Node.js 20+
- npm 10+
Commandes¶
# Installation
npm install
# Serveur de développement
npm run dev
# → http://localhost:4321
# Build production
npm run build
# Preview build
npm run preview
Variables d'environnement¶
Aucune variable d'environnement requise (site statique).
Structure de build¶
Entrée¶
src/
├── pages/
│ ├── index.astro → /index.html (redirect)
│ ├── fr/
│ │ ├── index.astro → /fr/index.html
│ │ └── *.astro → /fr/*.html
│ └── en/
│ ├── index.astro → /en/index.html
│ └── *.astro → /en/*.html
└── ...
Sortie¶
dist/ → public/ (après mv)
├── index.html # Redirect → /fr/
├── fr/
│ ├── index.html
│ ├── product/index.html
│ ├── use-cases/index.html
│ ├── pricing/index.html
│ ├── about/index.html
│ ├── contact/index.html
│ └── legal/
│ ├── mentions-legales/index.html
│ └── politique-confidentialite/index.html
├── en/
│ └── ... (même structure)
├── og/
│ └── *.png
├── _astro/
│ └── *.css
├── robots.txt
├── sitemap.xml
└── favicon.svg
Rollback¶
Via GitLab CI¶
- Aller dans CI/CD > Pipelines
- Trouver le dernier pipeline réussi avant la régression
- Cliquer sur Retry sur le job
pages
Manuel¶
Monitoring¶
GitLab Pages Status¶
- URL : https://gitlab.com/probatiovault/probatiovault-site/-/pages
- Logs : CI/CD > Jobs >
pages
Uptime¶
Surveillance externe recommandée :
- UptimeRobot (gratuit)
- Better Uptime
Performance¶
Checklist déploiement¶
Avant merge sur main¶
- Build local réussi (
npm run build) - Preview vérifié (
npm run preview) - Liens internes fonctionnels
- Images OpenGraph présentes
- Meta tags corrects
- Responsive vérifié (mobile/tablet/desktop)
Après déploiement¶
- Site accessible sur https://probatiovault.com
- Certificat SSL valide
- Redirections OK (/ → /fr/)
- OpenGraph Debugger Facebook
- Twitter Card Validator
- Google Search Console
Dépannage¶
Build échoue¶
# Vérifier les erreurs TypeScript
npm run build 2>&1 | grep -i error
# Nettoyer cache
rm -rf node_modules .astro
npm install
npm run build
Pages non mises à jour¶
- Vérifier que le pipeline a réussi
- Attendre la propagation (2-5 min)
- Vider le cache navigateur (Ctrl+Shift+R)
- Vérifier le cache CDN GitLab Pages
DNS ne résout pas¶
# Vérifier propagation DNS
dig probatiovault.com +short
# Attendre propagation (jusqu'à 48h)
# Vérifier configuration OVH/Terraform
Certificat SSL invalide¶
- Désactiver/réactiver HTTPS dans GitLab Pages
- Vérifier que le DNS pointe vers GitLab
- Attendre régénération Let's Encrypt (quelques minutes)