You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Postgres Restore from SQL Backup
v4.6
Restore a postgres service container using a sql backup file with psql.
NOTE: This only supports sql backups.
- Create a backup using
$ cd [project_root]
$ mkdir backups
$ pg_dump -O -f backups/backup.sql $DATABASE_URL
See: https://github.com/tj-actions/pg-dump
Add action to .github/workflows
...
steps:
- uses: actions/checkout@v2
- name: Postgres Backup Restore
uses: tj-actions/[email protected]
with:
database_url: "postgres://test_user:test_password@localhost:5432/test_db"
backup_file: "backups/backup.sql"
INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION |
---|---|---|---|---|
backup_file | string | true | Backup file name | |
database_url | string | true | Database URL | |
options | string | false | Extra options to pass directly to psql |
- Free software: MIT license
If you feel generous and want to show some extra appreciation:
This package was created with Cookiecutter.
Report bugs at https://github.com/tj-actions/pg-restore/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your workflow that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.