Dump GLVD Postgres Snapshot #38
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
name: Dump GLVD Postgres Snapshot | |
on: | |
workflow_dispatch: | |
jobs: | |
dump-db-snapshot: | |
runs-on: ubuntu-latest | |
container: ghcr.io/gardenlinux/glvd:edge | |
env: | |
PGUSER: glvd | |
PGDATABASE: glvd | |
PGPASSWORD: glvd | |
PGHOST: postgres | |
PGPORT: 5432 | |
services: | |
postgres: | |
image: ghcr.io/gardenlinux/glvd-postgres:edgenotls | |
env: | |
POSTGRES_USER: glvd | |
POSTGRES_DB: glvd | |
POSTGRES_PASSWORD: glvd | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Ingest Data | |
run: /usr/local/src/ingest-postgres.sh | |
- run: | | |
echo "$PGHOST:$PGPORT:$PGDATABASE:$PGUSER:$PGPASSWORD" > ~/.pgpass | |
chmod 0600 ~/.pgpass | |
- run: psql glvd -f extra-schema.sql | |
- name: Dump Database Snapshot | |
run: | | |
pg_dump -h postgres -p 5432 -U glvd glvd > glvd.sql | |
- name: Dump Database Schema | |
run: | | |
pg_dump --schema-only -h postgres -p 5432 -U glvd glvd > glvd-schema.sql | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: glvd.sql | |
path: glvd.sql | |
retention-days: 2 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: glvd-schema.sql | |
path: glvd-schema.sql | |
retention-days: 2 |