我正在尝试在 github actions 中使用 docker 连接到 Postgres。这是我的 github 操作文件:
name: Carbon Link backend server CI
on:
push:
branches: [ 'develop', 'PC-3-setup-github-actions-on-pr-request' ]
pull_request:
branches: [ 'develop', 'PC-3-setup-github-actions-on-pr-request' ]
jobs:
# label of the container job
postgres-test:
runs-on: ubuntu-latest
container: node:latest
services:
postgres:
image: postgres:latest
# `POSTGRES_HOST` is `postgres`
env:
POSTGRES_DB: carbonlink
POSTGRES_PASSWORD: password
# optional (defaults to `5432`)
POSTGRES_PORT: 5432
# optional (defaults to `postgres`)
POSTGRES_USER: postgres
ports:
- 5432:5432
# set health checks to wait until postgres has started …Run Code Online (Sandbox Code Playgroud)