From 5a32811842680c5a8309bcb55802292a025d8786 Mon Sep 17 00:00:00 2001 From: Matthias Guillitte Date: Thu, 16 Jul 2026 18:45:47 +0200 Subject: [PATCH] Alright, NOW, it should do the trick --- .github/workflows/deploy.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index a8bceee..5c3ccc0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -37,11 +37,19 @@ jobs: steps: - name: Notify Watchtower run: | - # 1. Dynamically grab the Docker gateway IP of the host machine - HOST_IP=$(ip route | awk '/default/ {print $3}') + # 1. Grab the default gateway hex code from the routing table + HEX_GW=$(awk '$2 == "00000000" {print $3; exit}' /proc/net/route) + + # 2. Convert little-endian Hex (e.g., 010011AC) to standard Decimal IP (172.17.0.1) + if [ -n "$HEX_GW" ]; then + HOST_IP=$(printf "%d.%d.%d.%d" 0x${HEX_GW:6:2} 0x${HEX_GW:4:2} 0x${HEX_GW:2:2} 0x${HEX_GW:0:2}) + else + HOST_IP="172.17.0.1" # Standard fallback + fi + echo "Detected Docker Host Gateway IP: $HOST_IP" - # 2. Trigger Watchtower directly over local HTTP port 8080 + # 3. Trigger Watchtower directly over local HTTP port 8080 curl -i -X POST \ -H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \ - "http://$HOST_IP:8007/v1/update" \ No newline at end of file + "http://$HOST_IP:8080/v1/update" \ No newline at end of file