-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.1 KB
/
Copy pathdeploy-studio.yml
File metadata and controls
38 lines (31 loc) · 1.1 KB
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
name: Deploy Sanity Studio
on:
workflow_dispatch:
push:
branches: [main, master]
paths:
- 'studio/**'
- '.github/workflows/deploy-studio.yml'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: studio/pnpm-lock.yaml
- name: Install Studio dependencies
working-directory: studio
run: pnpm install --frozen-lockfile
- name: Require SANITY_DEPLOY_TOKEN
env:
SANITY_AUTH_TOKEN: ${{ secrets.SANITY_DEPLOY_TOKEN }}
run: test -n "$SANITY_AUTH_TOKEN" || (echo '::error::Add repository secret SANITY_DEPLOY_TOKEN (https://sanity.io/manage → your project → API). Use a token with access to deploy Studio; it is not the same as SANITY_WRITE_TOKEN.' && exit 1)
- name: Deploy to Sanity Hosting
working-directory: studio
env:
SANITY_AUTH_TOKEN: ${{ secrets.SANITY_DEPLOY_TOKEN }}
run: pnpm exec sanity deploy -y