Backup Database #130
This file contains 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: Backup Database | |
on: | |
schedule: | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
jobs: | |
backup: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
name: Download and Push | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Firebase | |
run: npm install -g firebase-tools | |
- name: Make directory | |
run: mkdir backup | |
- name: Download | |
run: firebase --project="${{ secrets.FIREBASE_PROJECT_ID }}" database:get / > backup/database.json | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_SECRET }} | |
- name: Push | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: db-backup | |
FOLDER: backup | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "Database Backup" |