Update sanity.config.ts #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy sanity studio | |
on: | |
push: | |
branches: [main] | |
paths: | |
- sanity/** | |
jobs: | |
# Deploy job | |
deploy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./sanity | |
# Secrets stored in GitHub repo settings | |
env: | |
SANITY_AUTH_TOKEN: ${{ secrets.SANITY_AUTH_TOKEN }} | |
SANITY_STUDIO_PREVIEW_URL: ${{ secrets.SANITY_STUDIO_PREVIEW_URL}} | |
SANITY_PROJECT_ID: ${{ secrets.SANITY_PROJECT_ID}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
cache: npm | |
# Doesn't respect working-directory above so pass full path | |
cache-dependency-path: sanity/package-lock.json | |
- name: Install dependencies | |
run: npm install | |
- name: Deploy to Sanity | |
run: npm run deploy |