Skip to content

Backup Firestore

Backup Firestore #570

Workflow file for this run

name: Backup Firestore
on:
schedule:
- cron: '0 0 * * *'
# enables manual triggering of the workflow
workflow_dispatch:
env:
PROJECT_ID: sweatnotes-sn
BUCKET: gs://sweatnotes-sn-backups
jobs:
backup:
runs-on: ubuntu-latest
steps:
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.SWEATNOTES_BACKUP_SERVICE_ACCOUNT_CREDENTIALS_JSON }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- run: gcloud info
- run: gcloud config set project $PROJECT_ID
- run: gcloud firestore export $BUCKET