-
Notifications
You must be signed in to change notification settings - Fork 8
34 lines (34 loc) · 1.07 KB
/
dataset-backup.yaml
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
30
31
32
33
34
name: Backup Routine
on:
workflow_dispatch:
#schedule:
# Runs at 02:00 UTC every sunday
# - cron: '0 2 * * 0'
jobs:
backup-dataset:
runs-on: ubuntu-latest
name: Backup dataset
strategy:
matrix:
dataset: ['global-development'] #${{ fromJson(needs.read-satellites.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Export Data
env:
SANITY_AUTH_TOKEN: ${{ secrets.SANITY_DEPLOY }}
run: |
npm install -g @sanity/cli
sanity install
SANITY_AUTH_TOKEN=$SANITY_AUTH_TOKEN sanity dataset export ${{ matrix.dataset }} backups/backup-${{ matrix.dataset }}.tar.gz
- name: Upload backup.tar.gz
uses: actions/upload-artifact@v2
with:
name: backup-tarball
path: backups/${{ matrix.dataset }}.tar.gz
# Fails the workflow if no files are found; defaults to 'warn'
if-no-files-found: error
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()