-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.15 KB
/
backup-db.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
name: Backup production database
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # 04:00 UTC
push:
branches:
- backup-db
jobs:
backup:
name: Backup database
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.5.0
terraform_wrapper: false
- uses: DFE-Digital/github-actions/set-arm-environment-variables@master
with:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
- name: Get Azure backup storage details
id: azure-backup-storage
run: |
set -e
#make ci production_aks terraform-init
make ci production_aks
terraform -chdir=terraform/aks init -backend-config workspace_variables/production.backend.tfvars -reconfigure -input=false
echo "account-name=$(terraform -chdir=terraform/aks output -raw postgres_azure_backup_storage_account_name)" >> $GITHUB_OUTPUT
echo "container-name=$(terraform -chdir=terraform/aks output -raw postgres_azure_backup_storage_container_name)" >> $GITHUB_OUTPUT