ci: 修复 Gitea Actions 数据库连接(用服务名 postgres) #2

Merged
lixu merged 1 commits from devin/1781859199-ci-fix-postgres-host into main 2026-06-19 17:47:41 +08:00
+2 -6
View File
@@ -19,13 +19,11 @@ jobs:
POSTGRES_USER: opengoods POSTGRES_USER: opengoods
POSTGRES_PASSWORD: opengoods POSTGRES_PASSWORD: opengoods
POSTGRES_DB: opengoods POSTGRES_DB: opengoods
ports:
- "5432:5432"
options: >- options: >-
--health-cmd "pg_isready -U opengoods" --health-cmd "pg_isready -U opengoods"
--health-interval 5s --health-timeout 5s --health-retries 10 --health-interval 5s --health-timeout 5s --health-retries 10
env: env:
OPENGOODS_DATABASE_URL: postgres://opengoods:opengoods@localhost:5432/opengoods?sslmode=disable OPENGOODS_DATABASE_URL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5
@@ -73,13 +71,11 @@ jobs:
POSTGRES_USER: opengoods POSTGRES_USER: opengoods
POSTGRES_PASSWORD: opengoods POSTGRES_PASSWORD: opengoods
POSTGRES_DB: opengoods POSTGRES_DB: opengoods
ports:
- "5432:5432"
options: >- options: >-
--health-cmd "pg_isready -U opengoods" --health-cmd "pg_isready -U opengoods"
--health-interval 5s --health-timeout 5s --health-retries 10 --health-interval 5s --health-timeout 5s --health-retries 10
env: env:
DBURL: postgres://opengoods:opengoods@localhost:5432/opengoods?sslmode=disable DBURL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-go@v5 - uses: actions/setup-go@v5