34 lines
No EOL
803 B
YAML
34 lines
No EOL
803 B
YAML
name: Weekly K8s Storage Backup
|
|
|
|
on:
|
|
schedule:
|
|
# Sunday 02:30 UTC (quiet time, predictable)
|
|
- cron: "30 2 * * 0"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
backup:
|
|
name: Backup /k8s_storage → S3
|
|
runs-on: mealcraft-runners
|
|
timeout-minutes: 180
|
|
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Sanity check mount
|
|
run: |
|
|
echo "Listing /k8s_storage:"
|
|
ls -lah /k8s_storage
|
|
|
|
- name: Verify AWS identity
|
|
run: aws sts get-caller-identity
|
|
|
|
- name: Run backup
|
|
run: |
|
|
bash scripts/backup_k8s_storage_to_s3.sh
|
|
|
|
|
|
# example of restoring a back up
|
|
# aws s3 cp s3://mist-backups/2025-03-09/k8s_storage_mist_2025-03-09_02-30-01.tar.gz .
|
|
# sudo tar -xzf k8s_storage_*.tar.gz -C /home/kimjunte/k8s_storage |