Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@ jobs:
if: ${{ github.repository_owner == 'SwiftLeeds' }}

steps:
- name: Install PostgreSQL client
run: sudo apt-get update && sudo apt-get install -y postgresql-client
- name: Install PostgreSQL 17 client
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-client-17

- name: Dump production database (public schema only)
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
pg_dump "$DATABASE_URL" \
/usr/lib/postgresql/17/bin/pg_dump "$DATABASE_URL" \
--schema=public \
--no-owner \
--no-privileges \
Expand All @@ -30,7 +34,7 @@ jobs:
env:
STAGING_DATABASE_URL: ${{ secrets.STAGING_DATABASE_URL }}
run: |
pg_restore \
/usr/lib/postgresql/17/bin/pg_restore \
--clean \
--if-exists \
--no-owner \
Expand Down