name: Mirror repository to S3
on:
  push:
    branches:
      - master
jobs:
  BackupRepoToS3:
    runs-on: [self-hosted, generic]
    permissions:
      contents: read
      id-token: write # used by oidc connect to aws for s3 upload
    steps:
      - name: backup repo
        uses: mattrinternal/sre-reusable-action/actions/github-backup@master
        with:
          aws_region: ${{ vars.GLOBAL_BACKUP_AWS_REGION }}
          role_to_assume: ${{ vars.GLOBAL_BACKUP_OIDC_ROLE_ARN }}
