Skip to content

Create backup

Create backup #17

Workflow file for this run

name: Create backup
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
concurrency: dump
jobs:
run:
runs-on: ubuntu-latest
name: Run
steps:
- name: Setup PostgreSQL
uses: tj-actions/install-postgresql@v3
with:
postgresql-version: 16
- name: Dump
env:
PGHOST: ${{ secrets.PGHOST }}
PGPORT: ${{ secrets.PGPORT }}
PGDATABASE: ${{ secrets.PGDATABASE }}
PGUSER: ${{ secrets.PGUSER }}
PGPASSWORD: ${{ secrets.PGPASSWORD }}
PGSSLMODE: require
run: |
pg_dump --dbname=${{secrets.PGDATABASE}} --file="data" --clean --format=d --inserts --verbose --jobs=8 --no-privileges
- uses: actions/upload-artifact@v4
with:
name: Backup
path: data