Files
alapatch/.gitea/workflows/deploy.yml
T
cvancau 8f30ea58c9
Deploy to home / deploy (push) Successful in 1s
Actualiser .gitea/workflows/deploy.yml
2026-08-09 15:16:03 +02:00

34 lines
1.0 KiB
YAML

name: Deploy to home
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: [self-hosted, linux]
steps:
- name: Deploy via SSH
shell: bash
run: |
echo "Vérification locale de la clé SSH sur le Runner..."
if [ ! -f /root/.ssh/id_home ]; then
echo "ERREUR : La clé /root/.ssh/id_home est introuvable sur ce Runner !"
exit 1
fi
echo "Tentative de connexion et réplication..."
# L'option -v (Verbose) va nous afficher TOUT le protocole de connexion dans les logs
ssh -v -o StrictHostKeyChecking=no -o BatchMode=yes -i /root/.ssh/id_home root@home.mesdonneesadministratives.fr "
cd /opt/alapatch &&
echo '=> Dossier actuel :' && pwd &&
echo '=> Statut Git avant :' && git status &&
git fetch --all &&
git reset --hard origin/main &&
echo '=> Statut Git après :' && git log -1 --oneline
"