github-actions

Back up Postgres

Back up an Azure Postgresql server database and upload the backup file to an Azure storage account Designed for scheduled backups as well as disaster recovery procedures

OIDC

Federated credentials must be set up to allow the action to authenticate to Azure and kubernetes

Inputs

Examples

Regular Backup

jobs:
  regular-backup:
    permissions:
      id-token: write # Required for OIDC authentication to Azure

    steps:
      - name: Backup postgres
        uses: DFE-Digital/github-actions/backup-postgres@master
        with:
          storage-account: myserviceqabkpsa
          resource-group: s189t01-app-rg
          app-name: myservice-qa
          cluster: test
          namespace: $
          azure-client-id: $
          azure-subscription-id: $
          azure-tenant-id: $
          backup-file: backup290224.sql
          slack-webhook: $

Backup with Excluded Tables

jobs:
  backup-with-excluded-tables:
    permissions:
      id-token: write # Required for OIDC authentication to Azure

    steps:
      - name: Backup postgres with excluded tables
        uses: DFE-Digital/github-actions/backup-postgres@master
        with:
          storage-account: myserviceqabkpsa
          resource-group: s189t01-app-rg
          app-name: myservice-qa
          cluster: test
          namespace: $
          azure-client-id: $
          azure-subscription-id: $
          azure-tenant-id: $
          backup-file: excluded-tables-backup290224.sql
          slack-webhook: $
          exclude-tables: "users audit_logs sensitive_data"