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