tj-actions / pg-dump Goto Github PK
View Code? Open in Web Editor NEW:octocat: Github action to generate backup of a postgres database.
License: MIT License
:octocat: Github action to generate backup of a postgres database.
License: MIT License
I actually have a Postgres 14 db but the action trigger that a version mismatch occur
configure the version in the yml
No response
No response
I'm proxying a database connection to a Postgres app hosted on fly.io. I receive the following error:
pg_dump: error: server version: 15.3 (Debian 15.3-1.pgdg120+1); pg_dump version: 14.9 (Ubuntu 14.9-1.pgdg22.04+1)
pg_dump: error: aborting because of server version mismatch
Error: Process completed with exit code 1.
I've seen in #35 that the action should be agnostic regarding Postgres versions, so I've filed this as a bug.
name: Backup postgres database
on:
workflow_dispatch:
jobs:
backup:
name: Postgres backup
runs-on: ubuntu-latest
env:
FLY_API_TOKEN: ${{ secrets.FLY_POSTGRES_APP_API_TOKEN }}
POSTGRES_APP_NAME: ${{ vars.POSTGRES_APP_NAME }}
PG_PASSWORD: ${{ secrets.POSTGRES_PASS }}
PG_USER: ${{ vars.POSTGRES_USER }}
PG_DBNAME: ${{ vars.POSTGRES_DB_NAME }}
BACKUPS_DIR: backups/postgres
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up flyctl
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Proxy to app
run: flyctl proxy 5432 -a ${{ env.POSTGRES_APP_NAME }} &
- name: Get current date and time
id: timestamp
run: echo "TIMESTAMP=$(date +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_ENV
- name: Set output path
run: |
echo "OUTPUT_PATH=${{ env.BACKUPS_DIR }}/db${{ env.TIMESTAMP }}.backup" >> $GITHUB_ENV
- name: Sleep 3 seconds
run: sleep 3
- name: Postgres Dump Backup
uses: tj-actions/[email protected]
with:
database_url: "postgres://${{ env.PG_USER }}:${{ env.PG_PASSWORD }}@localhost:5432/${{ env.PG_DBNAME }}"
path: ${{ env.OUTPUT_PATH }}
options: "-Fc"
ubuntu-latest or ubuntu-22.04
completion of the action
pg_dump: error: server version: 15.3 (Debian 15.3-1.pgdg120+1); pg_dump version: 14.9 (Ubuntu 14.9-1.pgdg22.04+1)
pg_dump: error: aborting because of server version mismatch
Error: Process completed with exit code 1.
No response
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/codacy-analysis.yml
actions/checkout v4
codacy/codacy-analysis-cli-action v4.4.0
github/codeql-action v3
.github/workflows/rebase.yml
actions/checkout v4
cirrus-actions/rebase 1.8
.github/workflows/sync-release-version.yml
actions/checkout v4
tj-actions/release-tagger v4
tj-actions/sync-release-version v13
tj-actions/git-cliff v1
peter-evans/create-pull-request v6.0.5
.github/workflows/test.yml
actions/checkout v4
reviewdog/action-shellcheck v1.20
actions/checkout v4
tj-actions/verify-changed-files v20
actions/checkout v4
tj-actions/verify-changed-files v20
postgres 9.6.24
.github/workflows/update-readme.yml
actions/checkout v4
tj-actions/auto-doc v3
tj-actions/remark v3
tj-actions/verify-changed-files v20
peter-evans/create-pull-request v6
action.yml
tj-actions/install-postgresql v3
- name: pg_dump into local file
uses: tj-actions/pg-dump@v1
with:
database_url: "postgresql://...
path: dump.sql
options: -O --compress=5
- name: pg_dump into local file
uses: tj-actions/pg-dump@v1
with:
database_url: "postgresql://...
path: dump.sql
options: -O --compress=5
ubuntu-latest or ubuntu-20.04
pg_dump -O --compress=5 -f "dump.sql" -d "***
pg_dump "-O --compress=5" -f "dump.sql" -d "***
No response
No
I'm basically looking to use this GH action as a full-featured way to create PSQL database backups and send them, encrypted, to a storage somewhere. I'd like it to be as simple and foolproof as possible, so potentially sending the encrypted database to Dropbox would be easy to manage.
I'd be happy to help with a PR if this seems like an appropriate/doable feature for the repo!
backupsheep.com, simplebackups.com
No response
Run tj-actions/pg-dump@v3
Run tj-actions/install-postgresql@v2
Run bash $GITHUB_ACTION_PATH/entrypoint.sh
setup-postgresql
Verifying version
Error: 16 is not between 10 and 15 (inclusive).
Error: Process completed with exit code 1.
ubuntu-latest or ubuntu-22.04
Please add support for latest version of postgres
Run tj-actions/pg-dump@v3
Run tj-actions/install-postgresql@v2
Run bash $GITHUB_ACTION_PATH/entrypoint.sh
setup-postgresql
Verifying version
Error: 16 is not between 10 and 15 (inclusive).
Error: Process completed with exit code 1.
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.