Manual Database Backup #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Manual Database Backup | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Environment to backup (production/development)' | |
required: true | |
default: 'production' | |
type: choice | |
options: | |
- production | |
- development | |
jobs: | |
backup: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install Heroku CLI | |
run: curl https://cli-assets.heroku.com/install.sh | sh | |
- name: Create Heroku Postgres Backup | |
env: | |
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} | |
APP_NAME: ${{ github.event.inputs.environment == 'production' && secrets.HEROKU_APP_NAME_PRODUCTION || secrets.HEROKU_APP_NAME_DEVELOPMENT }} | |
run: | | |
heroku pg:backups:capture --app $APP_NAME |