From da2d7b81257ec8f60a7560d7c2a69a06574ed13d Mon Sep 17 00:00:00 2001 From: Colin Saliceti Date: Mon, 15 Jul 2024 10:22:42 +0100 Subject: [PATCH] Database restore workflow Download backup from Azure storage and restore it to the production environment --- .github/workflows/database_restore.yml | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/database_restore.yml diff --git a/.github/workflows/database_restore.yml b/.github/workflows/database_restore.yml new file mode 100644 index 0000000000..1d2354a392 --- /dev/null +++ b/.github/workflows/database_restore.yml @@ -0,0 +1,31 @@ +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' + +jobs: + restore: + name: Restore AKS Database (production) + runs-on: ubuntu-latest + environment: production-aks + + steps: + - 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: capt_prod_$(date +"%F").sql.gz