Files
deploy 785b3c5b43
Déploiement Hugo Staging / deploy-staging (push) Waiting to run
Site vitrine 2.0 — modernisation UI (nav, home, typo, shortcodes).
Intègre feature/modernisation-vitrine en squash. Workflows : staging sur
site/v3 uniquement ; production en workflow_dispatch (jamais sur push).
2026-10-08 12:24:52 +02:00

35 lines
1.3 KiB
YAML

# Production : lancement manuel uniquement.
# Aucun push (master, site/v3, …) ne doit déployer ptits-pas.fr.
name: Déploiement Hugo production
on:
workflow_dispatch:
jobs:
deploy-production:
runs-on: self-hosted
steps:
- name: Déployer sur ptits-pas.fr (ordre explicite)
shell: bash
run: |
set -e
COMPOSE_DIR=/home/deploy/infra_v2/apps/site-vitrine
SITE_DIR=/home/deploy/infra_v2/site-vitrine
git config --global --add safe.directory "$SITE_DIR"
cd "$SITE_DIR"
# Ne pas écraser static/robots.txt (Allow prod, hors sync Git)
git fetch origin
git checkout master
git pull --ff-only origin master
/bin/cp -f /home/deploy/infra_v2/backups/robots-prod-allow-2026-10-08.txt "$SITE_DIR/static/robots.txt" 2>/dev/null || true
cd "$COMPOSE_DIR"
docker compose -f docker-compose.yml run --rm hugo-build
# Restaurer Allow dans public après build Hugo (static peut être Disallow en Git)
/bin/cp -f /home/deploy/infra_v2/backups/robots-prod-allow-2026-10-08.txt /home/deploy/infra_v2/site-vitrine/public/robots.txt
docker compose -f docker-compose.yml up -d --force-recreate site-vitrine
echo "Production mise à jour à $(date)"