diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml new file mode 100644 index 000000000..ba6431a05 --- /dev/null +++ b/.github/workflows/check-docs.yml @@ -0,0 +1,23 @@ +name: Fern Check + +on: + pull_request: + push: + branches: + - main + +jobs: + run: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./docs + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Fern + run: npm install -g fern-api + + - name: Check API is valid + run: fern check \ No newline at end of file diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml new file mode 100644 index 000000000..33ee6cc4b --- /dev/null +++ b/.github/workflows/preview-docs.yml @@ -0,0 +1,33 @@ +name: Preview Docs + +on: pull_request + +jobs: + run: + runs-on: ubuntu-latest + permissions: write-all + defaults: + run: + working-directory: ./docs + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Fern + run: npm install -g fern-api + + - name: Generate preview URL + id: generate-docs + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: | + OUTPUT=$(fern generate --docs --preview 2>&1) || true + echo "$OUTPUT" + URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()') + echo "Preview URL: $URL" + echo "🌿 Preview your docs: $URL" > preview_url.txt + + - name: Comment URL in PR + uses: thollander/actions-comment-pull-request@v2.4.3 + with: + filePath: preview_url.txt \ No newline at end of file diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 000000000..26e020211 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,25 @@ +name: Publish Docs + +on: + push: + branches: + - main + +jobs: + run: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/heads/main') && github.run_number > 1 }} + defaults: + run: + working-directory: ./docs + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Fern + run: npm install -g fern-api + + - name: Publish Docs + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + run: fern generate --docs --log-level debug \ No newline at end of file diff --git a/docs/fern/docs.yml b/docs/fern/docs.yml index ecc7ffc31..f08c066c5 100644 --- a/docs/fern/docs.yml +++ b/docs/fern/docs.yml @@ -1,5 +1,6 @@ instances: - url: https://stack-auth.docs.buildwithfern.com + custom-domain: docs.stack-auth.com title: Stack Auth Documentation tabs: diff --git a/docs/fern/docs/pages/getting-started/users.mdx b/docs/fern/docs/pages/getting-started/users.mdx index 2cf3f3e3b..cb0f7c4f3 100644 --- a/docs/fern/docs/pages/getting-started/users.mdx +++ b/docs/fern/docs/pages/getting-started/users.mdx @@ -25,7 +25,7 @@ Because it's so common, `useUser()` is also exposed as a standalone hook. This m On Server Components, you don't need `useStackApp()`. Instead, you can just import the `StackServerApp` that you created in the previous chapter: -```tsx focus={5-6} title="Server user profile" +```tsx focus={4-5} title="Server user profile" import { stackServerApp } from "@/stack"; export default async function MyComponent() {