Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
keep only 7 days of production backups in Azure Storage.
Browse files Browse the repository at this point in the history
ltello committed Jan 31, 2025
1 parent d3d2ff5 commit 550714f
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -6,17 +6,31 @@ on:
- cron: "15 4 * * *" # 04:15 UTC

jobs:
generate-day_of_week:
runs-on: ubuntu-latest
outputs:
today_day: ${{ steps.get-day.outputs.today_day }}
steps:
- name: Get today's day of the week
id: get-day
run: echo "today_day=$(date +'%A')" >> $GITHUB_OUTPUT

backup-production-and-store-in-azure-storage:
uses: ./.github/workflows/backup-db.yml
needs: generate-day_of_week
with:
environment: production
backup-file: cpdec2_production_adhoc_${{ needs.generate-day_of_week.outputs.today_day }}
secrets:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}

restore-snapshot-from-azure-storage:
needs: backup-production-and-store-in-azure-storage
needs:
- generate-day_of_week
- backup-production-and-store-in-azure-storage
uses: ./.github/workflows/restore-snapshot-db-from-azure-storage.yml
with:
environment: production
backup-file: cpdec2_production_adhoc_${{ needs.generate-day_of_week.outputs.today_day }}
secrets:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}

0 comments on commit 550714f

Please sign in to comment.