-
Notifications
You must be signed in to change notification settings - Fork 1
29 lines (29 loc) · 1.03 KB
/
main.yml
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: Backup Routine
on:
schedule:
# Runs at 10:00 UTC on every day-of-month divisible by 30
# .-------------- minute (0 - 59)
# | .----------- hour (0 - 23)
# | | .-------- day of month (1 - 31)
# | | | .---- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .-- day of week (0 - 6) (Sunday=0 or 7)
# | | | | | OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
- cron: "0 10 */30 * *"
jobs:
backup-dataset:
runs-on: ubuntu-latest
name: Backup dataset
steps:
- uses: actions/checkout@v3
- run: npx @sanity/cli dataset export production backup.tar.gz
working-directory: studio
env:
SANITY_STUDIO_API_PROJECT_ID: 2vfoxb3h
SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: production
path: studio/backup.tar.gz
retention-days: 5