Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
785b3c5b43 |
@@ -0,0 +1,34 @@
|
|||||||
|
# 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)"
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Staging : push sur site/v3 uniquement.
|
||||||
|
name: Déploiement Hugo Staging
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- site/v3
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-staging:
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- name: Déployer sur staging.ptits-pas.fr
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
git config --global --add safe.directory /home/deploy/staging
|
||||||
|
/home/deploy/infra_v2/apps/hooks/deploy-hugo.sh
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
name: Déploiement Hugo Staging
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy-staging:
|
|
||||||
runs-on: self-hosted
|
|
||||||
steps:
|
|
||||||
- name: Déployer sur staging
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
# Déclare /home/deploy/staging comme safe pour Git
|
|
||||||
git config --global --add safe.directory /home/deploy/staging
|
|
||||||
|
|
||||||
# Dirige-toi dans le clone staging
|
|
||||||
cd /home/deploy/staging
|
|
||||||
|
|
||||||
# Récupère la dernière version de master
|
|
||||||
git pull origin master
|
|
||||||
|
|
||||||
# Relance le service Hugo-staging
|
|
||||||
docker compose -f /home/deploy/infra/docker-compose.staging.yml up -d
|
|
||||||
|
|
||||||
echo "Staging mis à jour à $(date)"
|
|
||||||
Reference in New Issue
Block a user