-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (50 loc) · 1.58 KB
/
import-dataset.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Upload dataset for cloned project
on:
workflow_dispatch:
inputs:
sanity-project-id:
required: true
type: string
sanity-project-dataset:
required: true
type: string
jobs:
backup-dataset:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_SANITY_PROJECT_ID: ${{ inputs.sanity-project-id }}
NEXT_PUBLIC_SANITY_DATASET: ${{ inputs.sanity-project-dataset }}
name: Backup dataset
steps:
- uses: actions/checkout@v4
- name: Export dataset
uses: sanity-io/[email protected]
env:
SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }}
with:
args: . dataset export production backups/backup.tar.gz
- name: Upload backup.tar.gz
uses: actions/upload-artifact@v2
with:
name: backup-tarball
path: backups/backup.tar.gz
# Fails the workflow if no files are found; defaults to 'warn'
if-no-files-found: error
# jobs:
# upload-dataset:
# runs-on: ubuntu-latest
# env:
# NEXT_PUBLIC_SANITY_PROJECT_ID: ${{ inputs.sanity-project-id }}
# NEXT_PUBLIC_SANITY_DATASET: ${{ inputs.sanity-project-dataset }}
# steps:
# - uses: sanity-io/[email protected]
# env:
# SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }}
# implementation WITHOUT sanity action
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v3
# with:
# node-version: '18'
# - run: npm install
# - run: SANITY_AUTH_TOKEN=tokent npx sanity debug --secrets
# implementation WITH sanity action