6.2 KiB
6.2 KiB
Deploiement GitHub Pages (site statique + module Lab interactif)
Prerequis
- Depot Git connecte a GitHub (
git remote -vnon vide). - Dependances installees:
npm installnpm --prefix apps/lab-interactif install
- Build module lab OK (
npm run lab:build). - Workflow present:
.github/workflows/deploy-pages.yml. - Fichiers de publication racine presents:
index.html,styles.css,script.jsassets/(dontassets/og-cover.jpg+assets/brand/*)robots.txt,sitemap.xml- favicons (
favicon*,apple-touch-icon.png)
Configuration GitHub Pages
- GitHub > depot > Settings > Pages.
- Dans Build and deployment:
- Source:
GitHub Actions
- Source:
- Enregistrer.
Pipeline deploiement
Workflow: Deploy Static Site + Lab to GitHub Pages
Le job build:
- installe les deps racine
- installe les deps du module
apps/lab-interactif - build le module interactif dans
lab/ - prepare un artifact
.pages-dist/(site + assets + lab) - deploye via
actions/deploy-pages
Commandes locales utiles
- Home statique:
python3 -m http.server 4173 - Lab dev:
npm run lab:dev - Lab build:
npm run lab:build - Tracking contract:
npm run tracking:check - Budget images critiques:
npm run image:budget - Storybook build:
npm run storybook:build - Preflight complet pages:
npm run preflight:pages - Build externe Astro (avec
/labinclus):npm run build:external
Déploiement externe Astro (Vercel/Netlify)
Objectif: publier dist/ généré par Astro pour une version hors GitHub Pages.
- Préparer les variables d’environnement:
PUBLIC_SITE_URL=https://<votre-domaine-vercel-ou-netlify>/(canonical + OG)- éventuellement
EXTERNAL_SITE_URLcomme alias pratique
- Note:
npm run build:externaléchoue volontairement si aucune de ces variables n'est définie (protection anti-canonical erroné). - Exécuter:
npm run build:external - GitLab/Netlify et Vercel détectent automatiquement
vercel.json/netlify.toml:vercel:npm run build:externalnetlify:npm run build:external
- Le build externe inclut:
- page Astro Home:
dist/index.html - page
dist/robots.txtetdist/sitemap.xml(générés selonPUBLIC_SITE_URL) - bundle Astro
_astro/ dist/lab/(copié aprèslab:build) silab/existe
- page Astro Home:
Notes de contrôle pour version externe
- Vérifier
https://<domaine-externe>/après déploiement. - Vérifier les ancres
/:#a-propos,#projets,#contact. - Vérifier que
canonicalcorrespond bien àPUBLIC_SITE_URL. - Vérifier OG/Twitter preview via cache buster si nécessaire.
- Vérifier la présence de
/lab/selon la stratégie produit.
Déploiement externe FTP (OVH)
Hôte cible: ftp://ecobsoleiq@ftp.cluster129.hosting.ovh.net:21/
Utilisateur: ecobsoleiq
- Build externe:
PUBLIC_SITE_URL=https://<ton-domaine-externe>/ npm run build:external
- Préparer les identifiants (hors repo):
- Copier
.env.ftp.examplevers.env.ftp - Remplacer
FTP_PASS=...par le vrai mot de passe - Garder
FTP_REMOTE_DIR=/www(recommandé OVH mutualisé) source .env.ftp(ou exporterFTP_PASS/FTP_HOSTen variable d'env)
- Copier
- Déploiement via script:
FTP_PASS='<ton_mot_de_passe>' FTP_REMOTE_DIR='/www' npm run deploy:ftp- ou, via fichier local:
source .env.ftp && npm run deploy:ftp - version one-shot avec build externe:
npm run deploy:web:ftp
- Vérifier:
https://<ton-domaine-externe>/https://<ton-domaine-externe>/#a-proposhttps://<ton-domaine-externe>/#projetshttps://<ton-domaine-externe>/#contact
Notes:
- Le script utilise
lftp; installe-le si absent:brew install lftpouapt-get install lftp. - Le script refuse de synchroniser vers
/par sécurité (utiliser/www). - Si ton host pointe vers un sous-répertoire, ajuste
FTP_REMOTE_DIR(ex:/www/). - Aucune donnée sensible n’est hardcodée dans le script (mot de passe via
FTP_PASSuniquement).
Exemple 1-liner (via fichier local .env.ftp):
PUBLIC_SITE_URL='https://example.com/' \
FTP_URL='ftp://ecobsoleiq@ftp.cluster129.hosting.ovh.net:21/' \
npm run build:external && source .env.ftp && npm run deploy:ftp
Exemple 1-liner (sans .env.ftp):
FTP_PASS='***' \
PUBLIC_SITE_URL='https://example.com/' \
FTP_HOST=ftp.cluster129.hosting.ovh.net \
FTP_USER=ecobsoleiq \
npm run build:external && npm run deploy:ftp
Stratégie de déploiement duale (si besoin business)
- Production: GitHub Pages reste la version publiée courante (
index.html,styles.css,script.js,/lab/). - Complément: version web hors GitHub possible via build Astro dédié (
npm run build:external), puis publication sur hôte dédié (Netlify/Vercel/custom). - Contrat immuable: ancres
#a-propos,#projets,#contact, labels CTA, et paramètres GA4 conservés entre versions.
Contrat tracking GTM + GA4
Container
- GTM:
GTM-5SLM67QF
Evenements principaux
cta_hero_projetscta_hero_contactcta_hero_profileoutbound_linkedin_contactoutbound_malt_contactoutbound_bandcamp_contactoutbound_github_contact
Evenements GitHub dedies
outbound_github_project_rtc_bl_phoneoutbound_github_project_zacusoutbound_github_project_siteoutbound_github_lab_morecta_lab_interactif_open
Compat historique
- Les liens GitHub critiques conservent
data-track-legacypour pousser aussi les evenements legacy.
Parametres obligatoires
event_category=engagementevent_label=<nom_evenement>destination=<domaine|ancre|path>
Verification post-deploiement
https://electron-rare.github.io/charge correctementhttps://electron-rare.github.io/lab/charge correctement- Ancres core home (
#a-propos,#projets,#contact) OK robots.txtaccessiblesitemap.xmlaccessible (inclut/+/lab/)- OG/Twitter preview OK
- GA4 Realtime voit les events clics
- GA4 DebugView confirme
event_label+destination - Search Console: sitemap soumis + indexation
/et/lab/
Notes de routage module C
- Le module lab utilise
HashRouterpour compatibilite hebergement statique (GitHub Pages). - Routes attendues:
/lab/(overview)/lab/#/signals/lab/#/prototypes