-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Sanity loader and add GH workflow to set up preview branch
- Loading branch information
Thomas Cristina de Carvalho
committed
Nov 20, 2023
1 parent
fa35b16
commit 12b3963
Showing
9 changed files
with
50 additions
and
49 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
templates/hydrogen-theme/.github/workflows/preview-branch-mirror.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
############### | ||
# This Workflow is used to mirror the main branch to a preview branch. | ||
# Useful for having a preview URL that can be used by Sanity Studio. | ||
############### | ||
name: Mirror Main Branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
mirror: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Fetch latest changes | ||
run: git fetch origin main | ||
|
||
- name: Push to Mirror Branch | ||
run: | | ||
git checkout -b preview | ||
git push --force origin preview | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { createQueryStore } from "@sanity/react-loader"; | ||
|
||
// This is the "smallest" possible version of a query store | ||
// Where stega-enabled queries only happen server-side to avoid bundle bloat | ||
export const queryStore = createQueryStore({ client: false, ssr: true }); | ||
|
||
export const { useLiveMode, useQuery } = queryStore; |
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
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