#!/usr/bin/env bash # push-gitea.sh — Pousse la branche main vers Gitea # Usage : bash scripts/push-gitea.sh # # Prérequis : variable d'environnement GITEA_TOKEN définie # (via Replit Secrets ou export GITEA_TOKEN=votre_token) set -e if [ -z "$GITEA_TOKEN" ]; then echo "Erreur : la variable GITEA_TOKEN n'est pas définie." echo "Définissez-la dans Replit > Secrets > Ajouter un secret : GITEA_TOKEN" exit 1 fi GITEA_USER="billisdead" GITEA_HOST="homegit.gyozamancave.fr" REPO="la-voix-du-peuple" B64=$(printf '%s' "${GITEA_USER}:${GITEA_TOKEN}" | base64 -w0) echo "Envoi de la branche main vers https://${GITEA_HOST}/${GITEA_USER}/${REPO}.git ..." GIT_TERMINAL_PROMPT=0 git \ -c "http.extraHeader=Authorization: Basic ${B64}" \ push origin main echo "Synchronisation terminée."