feat: add database backup action workflow #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Databas Backup GitHub Action Documentation
Resolves #93
Overview
This GitHub Action automates the process of backing up a MongoDB database. It schedules regular backups using a CRON expression and provides an option for manual execution. The backup is stored in a new database, and old backups are automatically deleted based on a specified retention limit.
Workflow Configuration
Workflow File:
.github/workflows/db-backup.yml
Secrets Configuration:
0 0 1 * *
for once a month).Script Path: Path to the backup script (
scripts/databaseBackup.js
).Usage Instructions
Running the Backup Script Manually
To run the backup script manually, trigger the GitHub Action from the Actions tab in your repository:
Automated Backups
For automated backups, ensure the
CRON_SCHEDULE
secret is set correctly. The workflow will run automatically based on the schedule defined in the CRON expression.Running the Backup Script with npm
If you want to run the backup script locally using
npm
, follow these steps: