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:
@@ -45,6 +45,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: mcr.microsoft.com/dotnet/sdk:10.0
|
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:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
@@ -94,6 +97,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: mcr.microsoft.com/dotnet/sdk:10.0
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
|
options: --add-host=gitea:host-gateway
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
env:
|
env:
|
||||||
@@ -118,6 +122,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
|
options: --add-host=gitea:host-gateway
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
env:
|
env:
|
||||||
@@ -147,6 +152,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
|
options: --add-host=gitea:host-gateway
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
env:
|
env:
|
||||||
@@ -176,6 +182,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
|
options: --add-host=gitea:host-gateway
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
env:
|
env:
|
||||||
@@ -205,6 +212,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: node:20-alpine
|
image: node:20-alpine
|
||||||
|
options: --add-host=gitea:host-gateway
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user