Skip to content

Backup

Backup #128

Workflow file for this run

name: Backup
on:
schedule:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch: # allow manual triggering
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
jobs:
backup:
environment: Heroku-DB-Backup
name: Download Heroku Backup Replace Oldest Local Backup
runs-on: ubuntu-latest
steps:
- name: Download Backup
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: |
mkdir -p ./backups/
filename=$(date +"%m_%d_%y").dump
heroku pg:backups:capture -a opencreorg
heroku pg:backups:download -a opencreorg --output=./backups/"${filename}"
- uses: actions/upload-artifact@v2
with:
name: opencreorg_db_backup
path: ./backups/*.dump
if-no-files-found: error
retention-days: 90 # 3 months of backups should be enough