diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 2a4d276..3a9a076 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -46,8 +46,19 @@ jobs: - name: Deploy Application Stack run: | echo "Deploying application stack using internal network..." + + # Obtenemos la IP Virtual del SERVICIO de gitea. Este es el método robusto. + GITEA_IP=$(docker service inspect gitea-stack_gitea --format '{{range .Endpoint.VirtualIPs}}{{.Addr}}{{end}}' | cut -d'/' -f1) + + if [ -z "$GITEA_IP" ]; then + echo "Error: Could not find Gitea service IP." + exit 1 + fi + echo "Gitea internal IP found: $GITEA_IP" + docker run --rm \ --network gitea-stack_gitea_net \ + --add-host=gitea:$GITEA_IP \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /opt/gestion-integral:/app \ -w /app \