Backup Firestore #549
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 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 |