-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: configure postgres via custom service 2
- Loading branch information
Showing
1 changed file
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,6 +208,19 @@ jobs: | |
AWS_SECRET_ACCESS_KEY: localstack | ||
AWS_REGION: us-east-1 | ||
|
||
services: | ||
postgres: | ||
image: ${{ (startsWith(matrix.database, 'postgres') ) && 'postgis/postgis:16-3.4' || '' }} | ||
env: | ||
# must specify password for PG Docker container image, see: https://registry.hub.docker.com/_/postgres?tab=description&page=1&name=10 | ||
POSTGRES_USER: ${{ env.POSTGRES_USER }} | ||
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | ||
POSTGRES_DB: ${{ env.POSTGRES_DB }} | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgres container does not provide a healthcheck | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -232,14 +245,14 @@ jobs: | |
- name: Start LocalStack | ||
run: pnpm docker:start | ||
|
||
- name: Start PostgreSQL | ||
uses: CasperWA/[email protected] | ||
with: | ||
postgresql version: '14' # See https://hub.docker.com/_/postgres for available versions | ||
postgresql db: ${{ env.POSTGRES_DB }} | ||
postgresql user: ${{ env.POSTGRES_USER }} | ||
postgresql password: ${{ env.POSTGRES_PASSWORD }} | ||
if: startsWith(matrix.database, 'postgres') | ||
# - name: Start PostgreSQL | ||
# uses: CasperWA/[email protected] | ||
# with: | ||
# postgresql version: '14' # See https://hub.docker.com/_/postgres for available versions | ||
# postgresql db: ${{ env.POSTGRES_DB }} | ||
# postgresql user: ${{ env.POSTGRES_USER }} | ||
# postgresql password: ${{ env.POSTGRES_PASSWORD }} | ||
# if: startsWith(matrix.database, 'postgres') | ||
|
||
- name: Install Supabase CLI | ||
uses: supabase/setup-cli@v1 | ||
|
@@ -262,7 +275,6 @@ jobs: | |
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "CREATE ROLE runner SUPERUSER LOGIN;" | ||
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "SELECT version();" | ||
echo "POSTGRES_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" >> $GITHUB_ENV | ||
sudo apt-get install -y postgis postgresql-14-postgis-3-scripts | ||
if: startsWith(matrix.database, 'postgres') | ||
|
||
- name: Configure PostgreSQL with custom schema | ||
|