Skip to content

Commit

Permalink
Create postgres backup workflow for DR testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RMcVelia committed Jun 21, 2024
1 parent b09b0bd commit a107613
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/dr-backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Backup Postgres for DR test

on:
workflow_dispatch:
inputs:
environment:
description: Environment to backup
required: true
type: choice
default: qa
options:
- qa
backup-file:
description: Filename of backup
required: true

push:
branches:
- 1857-dr-create-offline-postgres-backup-github-action

jobs:
main:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set variables
run: |
source global_config/qa.sh
# source global_config/${{ github.event.inputs.environment }}.sh
echo "STORAGE_ACCOUNT=${RESOURCE_NAME_PREFIX}rttdbbkp${CONFIG_SHORT}sa" >> $GITHUB_ENV
echo "RESOURCE_GROUP=${RESOURCE_NAME_PREFIX}-rtt-${CONFIG_SHORT}-rg" >> $GITHUB_ENV
echo "APP_NAME=register-${CONFIG}" >> $GITHUB_ENV
- name: Backup postgres
uses: DFE-Digital/github-actions/backup-postgres@1857-dr-create-offline-postgres-backup-github-action
with:
storage-account: ${{ env.STORAGE_ACCOUNT }}
resource-group: ${{ env.RESOURCE_GROUP }}
app-name: ${{ env.APP_NAME }}
azure-credentials: ${{ secrets.AZURE_CREDENTIALS_QA }}
environment: qa
backup-file: drbackup210624.sql
# azure-credentials: ${{ secrets[format('AZURE_CREDENTIALS_{0}', github.event.inputs.environment)] }}
# environment: ${{ github.event.inputs.environment }}
# backup-file: ${{ github.event.inputs.backup-file }}

0 comments on commit a107613

Please sign in to comment.