Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
hard-drive

GitHub Action

pg-dump

v2.1

pg-dump

hard-drive

pg-dump

Run pg_dump to generate a backup

Installation

Copy and paste the following snippet into your .yml file.

              

- name: pg-dump

uses: tj-actions/[email protected]

Learn more about this action in tj-actions/pg-dump

Choose a version

CI Update release version.

Run pg_dump to generate a backup

...
    steps:
      - uses: actions/checkout@v2
      - name: Postgres Dump Backup
        uses: tj-actions/pg-dump@v1
        with:
          database_url: "postgres://test_user:test_user_password@localhost:5432/testdb"
          path: "backups/backup.sql" 
          options: "-O"   

NOTE: ⚠️

  • Ensure the backup output file already exists.

Example

    steps:
      - uses: actions/checkout@v2
      - name: Create backup file
        run: |
          touch backups/backup.sql
      - name: Postgres Dump Backup
        uses: tj-actions/pg-dump@v1
        with:
          database_url: "postgres://test_user:test_user_password@localhost:5432/testdb"
          path: "backups/backup.sql" 
          options: "-O"   

Inputs

Input type required default description
database_url string true Database URL
path string true Backup file output location
options string true -O Extra options passed to pg_dump

Credits

This package was created with Cookiecutter.

Report Bugs

Report bugs at https://github.com/tj-actions/pg-dump/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.