Skip to content

Commit

Permalink
get database service from compose
Browse files Browse the repository at this point in the history
  • Loading branch information
TangoYankee committed Oct 8, 2024
1 parent e2443d0 commit 289726c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/update-api-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,16 @@ jobs:
FLOW_DATABASE_PASSWORD: ${{ secrets.FLOW_DATABASE_PASSWORD }}
FLOW_DATABASE_PORT: ${{ secrets.FLOW_DATABASE_PORT }}
FLOW_DATABASE_USER: ${{ secrets.FLOW_DATABASE_USER }}

name: Update database
runs-on: ubuntu-latest
services:
db:
image: postgis/postgis:15-3.4-alpine
env:
POSTGRES_USER: ${{ secrets.FLOW_DATABASE_USER }}
POSTGRES_PASSWORD: ${{ secrets.FLOW_DATABASE_PASSWORD }}
POSTGRES_DB: ${{ secrets.FLOW_DATABASE_NAME }}
TARGET_DATABASE_USER: ${{ secrets.TARGET_DATABASE_USER }}
TARGET_DATABASE_PASSWORD: ${{ secrets.TARGET_DATABASE_PASSWORD }}
TARGET_DATABASE_NAME: ${{ secrets.TARGET_DATABASE_NAME }}
TARGET_DATABASE_PORT: ${{ secrets.TARGET_DATABASE_PORT }}
TARGET_DATABASE_HOST: ${{ secrets.TARGET_DATABASE_HOST }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: checkout code
uses: actions/checkout@v4
- name: Initialize database service from compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: "compose.yml"
- name: install node
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
networks:
- data
ports:
- "8001:5432"
- $FLOW_DATABASE_PORT:5432
volumes:
- ./db/pg:/var/lib/postgresql/flow
networks:
Expand Down

0 comments on commit 289726c

Please sign in to comment.