Skip to content

Backup Database

Backup Database #128

Workflow file for this run

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"