.github/workflows/delern.yml #1258
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
on: | |
push: | |
schedule: | |
# Every day at 1:02 UTC: https://crontab.guru/#2_1_*_*_* | |
- cron: "2 1 * * *" | |
jobs: | |
backup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- uses: actions/checkout@v4 | |
with: | |
repository: futureware-tech/delern-database-backup | |
token: ${{ secrets.DATABASE_BACKUP_GITHUB_TOKEN }} | |
path: database-storage | |
- run: | | |
export GOOGLE_APPLICATION_CREDENTIALS="${HOME?}/.google_application_credentials.json" && | |
echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_DATA_DELERN }}' | \ | |
base64 -d > "${GOOGLE_APPLICATION_CREDENTIALS?}" && | |
npx firebase-tools \ | |
--project "${PROJECT?}" \ | |
database:get / | gzip > database-storage/database.json.gz | |
env: | |
PROJECT: delern-e1b33 | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "Automatic Realtime Database backup" | |
repository: database-storage | |
- uses: gautamkrishnar/keepalive-workflow@master |