Skip to content

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

  1. Creates on-demand backups
  2. Lists available backups with filtering and sorting
  3. Downloads backups for restoration
  4. Deletes old backups or specific backups
  5. Waits for backup completion with configurable timeouts

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: database

Create 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: filesystem

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: 30

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: completed

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-12345

Download 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: latest

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: 30

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.)

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: 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:
- 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: 90

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: database
  • 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, or delete (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 (asc or desc) (optional, default: desc)
  • filter_status: For list operation: Filter by backup status (completed, failed, running) (optional)
  • type: Type of data to backup - database or filesystem (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)
  • 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)
  • 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. Use wait: true when you need to ensure backup completes before proceeding
  5. Adjust max_retries based on expected backup duration (default timeout: 5 minutes)
  6. Test restores - Periodically verify backups can be restored
  7. Monitor backup jobs - Set up alerts for failures
  8. Document restore process - Ensure team knows how to restore