User DB Backup #345
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: User DB Backup | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "db/**" | |
| - ".github/workflows/user_db_backup.yml" | |
| schedule: | |
| - cron: "0 0 * * *" # Every day | |
| workflow_dispatch: | |
| jobs: | |
| backup: | |
| runs-on: self-hosted | |
| steps: | |
| - name: Backup User DB | |
| run: | | |
| cd /home/app/infra/db | |
| git pull | |
| bash cron_script.sh | |
| workflow-keepalive: | |
| if: github.event_name == 'schedule' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| steps: | |
| - uses: liskin/gh-workflow-keepalive@v1 |