diff --git a/.github/workflows/database_restore.yml b/.github/workflows/database_restore.yml index 1d2354a392..0de1903eb1 100644 --- a/.github/workflows/database_restore.yml +++ b/.github/workflows/database_restore.yml @@ -12,6 +12,9 @@ on: 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: @@ -20,6 +23,15 @@ jobs: 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: @@ -28,4 +40,4 @@ jobs: app-name: claim-additional-payments-for-teaching-production-web cluster: production azure-credentials: ${{ secrets.AZURE_CREDENTIALS }} - backup-file: capt_prod_$(date +"%F").sql.gz + backup-file: ${{ env.BACKUP_FILE }}