Skip to content

Backup Action

The Backup Action creates and manages backups of databases and files, with automated retention policies for cleanup.

Repository: quantcdn/quant-cloud-environment-backup-action

  1. Creates on-demand backups
  2. Schedules automatic backups
  3. Manages retention policies
  4. Cleans up old backups

Create a manual backup:

- uses: quantcdn/quant-cloud-environment-backup-action@v1
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: my-org
app_name: my-app
environment_name: production
backup_database: true
backup_files: true

Automatically clean up backups older than 7 days:

- uses: quantcdn/quant-cloud-environment-backup-action@v1
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: my-org
app_name: my-app
environment_name: production
backup_database: true
backup_files: true
retention_days: 7

Backup production every night:

name: Daily Backup
on:
schedule:
- cron: '0 1 * * *' # 1 AM daily
workflow_dispatch: # Allow manual trigger
jobs:
backup:
runs-on: ubuntu-latest
steps:
- name: Create backup
uses: quantcdn/quant-cloud-environment-backup-action@v1
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: ${{ secrets.QUANT_ORGANIZATION }}
app_name: my-app
environment_name: production
backup_database: true
backup_files: true
retention_days: 30 # Keep 30 days
- name: Notify on failure
if: failure()
run: |
echo "🚨 Backup failed!"
# Add notification logic (Slack, email, etc.)

Backup before deploying to production:

name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Backup before deployment
- name: Pre-deployment backup
uses: quantcdn/quant-cloud-environment-backup-action@v1
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: ${{ secrets.QUANT_ORGANIZATION }}
app_name: my-app
environment_name: production
backup_database: true
backup_files: true
# Deploy
- uses: quantcdn/quant-cloud-init-action@v1
id: init
- name: Build and push images
# ... build steps ...
- uses: quantcdn/quant-cloud-environment-action@v1
with:
operation: update

Weekly Full Backup with Extended Retention

Section titled “Weekly Full Backup with Extended Retention”

Keep weekly backups longer than daily:

name: Weekly Full Backup
on:
schedule:
- cron: '0 3 * * 0' # Sunday at 3 AM
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-latest
steps:
- uses: quantcdn/quant-cloud-environment-backup-action@v1
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: ${{ secrets.QUANT_ORGANIZATION }}
app_name: my-app
environment_name: production
backup_database: true
backup_files: true
retention_days: 90 # Keep 3 months

Backup destination before syncing data:

- name: Backup staging before sync
uses: quantcdn/quant-cloud-environment-backup-action@v1
with:
api_key: ${{ secrets.QUANT_API_KEY }}
organization: my-org
app_name: my-app
environment_name: staging
backup_database: true
backup_files: true
- name: Sync production to staging
uses: quantcdn/quant-cloud-environment-sync-action@v1
with:
source_environment: production
destination_environment: staging
  • Daily backups with 30-day retention
  • Pre-deployment backups kept indefinitely
  • Weekly full backups with 90-day retention
  • Daily backups with 7-day retention
  • Pre-sync backups with 7-day retention
  • On-demand only (no scheduled backups)
  • 3-day retention to save space
  1. Schedule regular backups - Don’t rely on manual backups
  2. Backup before risky operations - Deployments, syncs, migrations
  3. Set appropriate retention - Balance storage costs with recovery needs
  4. Test restores - Periodically verify backups can be restored
  5. Monitor backup jobs - Set up alerts for failures
  6. Document restore process - Ensure team knows how to restore