fix(ci): add --add-host=gitea:host-gateway to all container jobs

github.server_url returns 'http://gitea:3000' (Gitea ROOT_URL using Docker
service name). CI job containers run on an isolated network and can't resolve
the 'gitea' hostname.

host-gateway maps to the Docker bridge IP (172.17.0.1). Gitea publishes
port 3000 on all interfaces, so http://gitea:3000 becomes reachable inside
every job container via the bridge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-05-28 11:59:45 +03:30
parent 8ddb427edd
commit c452df8988
+8
View File
@@ -45,6 +45,9 @@ jobs:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:10.0
# host-gateway → docker bridge IP (172.17.0.1); Gitea port 3000 is
# published there, so 'gitea' hostname resolves from inside the job container
options: --add-host=gitea:host-gateway
services:
postgres:
image: postgres:16-alpine
@@ -94,6 +97,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:10.0
options: --add-host=gitea:host-gateway
steps:
- name: Checkout
env:
@@ -118,6 +122,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: node:20-alpine
options: --add-host=gitea:host-gateway
steps:
- name: Checkout
env:
@@ -147,6 +152,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: node:20-alpine
options: --add-host=gitea:host-gateway
steps:
- name: Checkout
env:
@@ -176,6 +182,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: node:20-alpine
options: --add-host=gitea:host-gateway
steps:
- name: Checkout
env:
@@ -205,6 +212,7 @@ jobs:
runs-on: ubuntu-latest
container:
image: node:20-alpine
options: --add-host=gitea:host-gateway
steps:
- name: Checkout
env: