Merge pull request #912 from kiosion/design-update #437
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: CI - Sanity | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**/*.md' | |
- 'LICENSE' | |
- '**/.husky' | |
- 'svelte-app/**' | |
- 'express-api/**' | |
- 'elixir-api/**' | |
concurrency: | |
group: sanity | |
cancel-in-progress: true | |
jobs: | |
build: | |
environment: Sanity | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 8.6.0 | |
run_install: false | |
- name: Use node_modules cache | |
uses: actions/cache@v3 | |
id: nm-cache | |
with: | |
path: 'sanity-cms/node_modules' | |
key: ${{ runner.os }}-npm-${{ hashFiles('sanity-cms/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-npm- | |
- name: Install Dependencies | |
if: steps.nm-cache.outputs.cache-hit != 'true' | |
run: (cd ./sanity-cms && pnpm install) | |
- name: Lint check | |
run: (cd ./sanity-cms && pnpm lint) | |
- name: Build for development | |
run: (cd ./sanity-cms && SANITY_STUDIO_DATASET="dev" pnpm sanity build) | |
- name: Deploy development studio | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEV_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
run: (cd ./sanity-cms && pnpm netlify deploy --dir=./dist --prod) | |
- name: Build for production | |
run: (cd ./sanity-cms && pnpm sanity build) | |
- name: Deploy production studio | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
run: (cd ./sanity-cms && pnpm netlify deploy --dir=./dist --prod) |