Update PostgreSQL client installation in backup workflow

This commit is contained in:
Janpeter Visser 2026-04-30 08:04:52 +02:00 committed by GitHub
parent e90383a284
commit 64e3f610a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,10 +2,8 @@ name: Daily Neon Database Backup
on: on:
schedule: schedule:
# Elke nacht om 02:00 UTC = 04:00 Nederlandse zomertijd / 03:00 wintertijd
- cron: "0 2 * * *" - cron: "0 2 * * *"
# Hiermee kun je handmatig testen via GitHub
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -13,10 +11,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install PostgreSQL client - name: Install PostgreSQL 17 client
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y postgresql-client sudo apt-get install -y curl ca-certificates gnupg
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /usr/share/keyrings/postgresql.gpg
echo "deb [signed-by=/usr/share/keyrings/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt noble-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt-get update
sudo apt-get install -y postgresql-client-17
pg_dump --version
- name: Create backup - name: Create backup
env: env:
@ -24,7 +27,7 @@ jobs:
run: | run: |
mkdir -p backups mkdir -p backups
DATE=$(date +"%Y-%m-%d_%H-%M-%S") DATE=$(date +"%Y-%m-%d_%H-%M-%S")
pg_dump "$DATABASE_URL" \ /usr/lib/postgresql/17/bin/pg_dump "$DATABASE_URL" \
--format=custom \ --format=custom \
--no-owner \ --no-owner \
--no-privileges \ --no-privileges \