-
Notifications
You must be signed in to change notification settings - Fork 16
44 lines (40 loc) · 1.35 KB
/
database_restore.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Restore Database from Azure Storage
concurrency: build_and_deploy_main
on:
workflow_dispatch:
inputs:
confirm:
description: Set to true to restore nightly backup to production
required: true
default: 'false'
type: choice
options:
- 'false'
- 'true'
backup-file:
description: Name of the backup file in Azure storage. e.g. capt_prod_2024-07-15.sql.gz. The default value is today's backup.
type: string
jobs:
restore:
name: Restore AKS Database (production)
if: inputs.confirm == 'true'
runs-on: ubuntu-latest
environment: production-aks
steps:
- name: Set backup file
run: |
if [ "${{ inputs.backup-file }}" != "" ]; then
BACKUP_FILE=${{ inputs.backup-file }}
else
BACKUP_FILE=capt_prod_$(date +"%F").sql.gz
fi
echo "BACKUP_FILE=$BACKUP_FILE" >> $GITHUB_ENV
- name: Restore postgres
uses: DFE-Digital/github-actions/restore-postgres-backup@master
with:
storage-account: s189p01captdbbkppdsa
resource-group: s189p01-capt-pd-rg
app-name: claim-additional-payments-for-teaching-production-web
cluster: production
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
backup-file: ${{ env.BACKUP_FILE }}