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
What It Does
Section titled “What It Does”- Creates on-demand backups
- Schedules automatic backups
- Manages retention policies
- Cleans up old backups
Basic Usage
Section titled “Basic Usage”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: trueWith Retention Policy
Section titled “With Retention Policy”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: 7Common Workflows
Section titled “Common Workflows”Scheduled Daily Backups
Section titled “Scheduled Daily Backups”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.)Pre-Deployment Backup
Section titled “Pre-Deployment Backup”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: updateWeekly 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 monthsBackup Before Sync
Section titled “Backup Before Sync”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: stagingBackup Strategies
Section titled “Backup Strategies”Production
Section titled “Production”- Daily backups with 30-day retention
- Pre-deployment backups kept indefinitely
- Weekly full backups with 90-day retention
Staging
Section titled “Staging”- Daily backups with 7-day retention
- Pre-sync backups with 7-day retention
Development/Preview
Section titled “Development/Preview”- On-demand only (no scheduled backups)
- 3-day retention to save space
Best Practices
Section titled “Best Practices”- Schedule regular backups - Don’t rely on manual backups
- Backup before risky operations - Deployments, syncs, migrations
- Set appropriate retention - Balance storage costs with recovery needs
- Test restores - Periodically verify backups can be restored
- Monitor backup jobs - Set up alerts for failures
- Document restore process - Ensure team knows how to restore
Next Steps
Section titled “Next Steps”- Sync Action - Sync data between environments
- Complete workflow examples