-
-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (28 loc) · 828 Bytes
/
backup.yaml
File metadata and controls
29 lines (28 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: DB Backup
on:
push:
branches: [ db-backup ]
workflow_dispatch: {}
schedule:
# nightly @ midnight
- cron: "0 0 * * *"
jobs:
backup:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Sops Binary Installer
uses: mdgreenwald/mozilla-sops-action@v1
with:
version: 'v3.5.0'
- name: Backup mongo db
run: |
sops -d secrets/service-account.json > /tmp/account.json
gcloud auth activate-service-account --key-file=/tmp/account.json
gcloud config set project "${{ secrets.PROJECT_ID }}"
make backup