forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup-verification.yml
More file actions
52 lines (46 loc) 路 1.4 KB
/
Copy pathbackup-verification.yml
File metadata and controls
52 lines (46 loc) 路 1.4 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Backup Verification
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
verify-backup:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: gistpin_backup_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download latest backup artifact
run: |
mkdir -p /tmp/backup
cp infrastructure/ci/backup-tests/sample-backup.sql /tmp/backup/latest.sql
- name: Verify backup restore and integrity
env:
TEST_DB_URL: postgres://postgres:postgres@localhost:5432/gistpin_backup_test
run: bash infrastructure/scripts/verify-backup.sh /tmp/backup/latest.sql
- name: Alert on verification failure
if: failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh issue create \
--repo PinSpace-Org/GistPin \
--title "Backup verification failed" \
--body "Automated backup verification failed in workflow run ${{ github.run_id }}." \
--label ci-cd || true