Skip to content

Commit

Permalink
Override backup file name in restore workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed Jul 15, 2024
1 parent 0f835c6 commit 4cdb8c5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/database_restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}

0 comments on commit 4cdb8c5

Please sign in to comment.