Backup Action
The Backup Action creates and manages backups of databases and filesystems in Quant Cloud environments. It supports creating, listing, downloading, and deleting backups with automated cleanup policies.
Repository: quantcdn/quant-cloud-environment-backup-action
What It Does
Section titled “What It Does”- Creates on-demand backups
- Lists available backups with filtering and sorting
- Downloads backups for restoration
- Deletes old backups or specific backups
- Waits for backup completion with configurable timeouts
Basic Usage
Section titled “Basic Usage”Create a database 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 operation: create type: databaseCreate a filesystem 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 operation: create type: filesystemWait for Completion
Section titled “Wait for Completion”Wait for the backup to complete before proceeding:
- 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 operation: create type: database wait: true wait_interval: 10 max_retries: 30List Backups
Section titled “List Backups”List available backups:
- 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 operation: list sort_order: desc filter_status: completedDownload Backup
Section titled “Download Backup”Download a specific 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 operation: download backup_id: backup-12345Download the latest 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 operation: download backup_id: latestDelete Old Backups
Section titled “Delete Old Backups”Delete backups older than 30 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 operation: delete older_than_days: 30Common 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 database 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 operation: create type: database backup_name: daily-backup-${{ github.run_number }} wait: true
- name: Create filesystem 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 operation: create type: filesystem backup_name: daily-backup-${{ github.run_number }} wait: true
- name: Cleanup old backups 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 operation: delete older_than_days: 30
- 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 database 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 operation: create type: database backup_name: pre-deploy-${{ github.sha }} wait: true
- name: Pre-deployment filesystem 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 operation: create type: filesystem backup_name: pre-deploy-${{ github.sha }} wait: 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: - name: Create weekly database 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 operation: create type: database backup_name: weekly-backup-${{ github.run_number }} wait: true
- name: Create weekly filesystem 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 operation: create type: filesystem backup_name: weekly-backup-${{ github.run_number }} wait: true
- name: Cleanup old backups (keep 90 days) 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 operation: delete older_than_days: 90Backup 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 operation: create type: database wait: true
- name: Sync production to staging uses: quantcdn/quant-cloud-environment-sync-action@v1 with: api_key: ${{ secrets.QUANT_API_KEY }} organization: my-org app_name: my-app environment_name: staging source: production type: databaseInputs
Section titled “Inputs”api_key: Quant API key (required)organization: Quant organisation ID (required)app_name: Name of your application (required)environment_name: Name of the environment to backup (required)operation: Operation to perform -create,list,download, ordelete(optional, default:create)backup_name: Name for the backup (optional, for create operation)backup_id: ID of the backup to download/delete. Use"latest"for most recent (optional)older_than_days: For delete operation: Delete backups older than this many days (optional)sort_order: For list operation: Sort order by creation date (ascordesc) (optional, default:desc)filter_status: For list operation: Filter by backup status (completed,failed,running) (optional)type: Type of data to backup -databaseorfilesystem(optional, default:database)wait: Whether to wait for the backup to complete (optional, default:false, only applies to create operation)wait_interval: Interval in seconds between status checks (optional, default:10)max_retries: Maximum number of retries before timing out (optional, default:30)base_url: Quant Cloud API URL (optional, default:https://dashboard.quantcdn.io/api/v3)
Outputs
Section titled “Outputs”success: Whether the operation was successful (boolean)backup_id: ID of the created backup (create operation)backup_list: JSON array of available backups (list operation)download_url: Download URL for the backup (download operation)resolved_backup_id: Actual backup ID when using “latest” (download operation)resolved_backup_name: Name of the resolved backup when using “latest” (download operation)resolved_backup_created_at: Creation timestamp of the resolved backup when using “latest” (download operation)deleted_count: Number of backups deleted (delete operation)deleted_backups: JSON array of deleted backup IDs (delete operation)
Backup 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
- Use
wait: truewhen you need to ensure backup completes before proceeding - Adjust
max_retriesbased on expected backup duration (default timeout: 5 minutes) - 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