-
Notifications
You must be signed in to change notification settings - Fork 2
24 lines (20 loc) · 766 Bytes
/
backup.yml
File metadata and controls
24 lines (20 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
name: Backup DB
on:
schedule:
# Everyday at 18:30 UTC (Midnight in Asia/Kolkata timezone)
- cron: "30 18 * * *"
jobs:
backup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl "${{ secrets.BASE_URL }}/api/backup" --request POST --create-dirs --output backup/data.json.gz
- run: |
git config --local user.email "abhayvashokan@gmail.com"
git config --local user.name "Abhay V Ashokan"
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
git add -A
if [[ -n $(git status --porcelain) ]]; then
git commit -m "Backup $(date +%F)"
git push --no-verify
fi