docs: update sidenav organization for react pages #48
Workflow file for this run
This file contains hidden or 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: Generate Fern Docs Preview | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
preview: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout aa-sdk | |
uses: actions/checkout@v4 | |
- name: Setup Docs | |
uses: ./.github/actions/setup-docs | |
with: | |
docs-github-token: ${{ secrets.DOCS_GITHUB_TOKEN }} | |
- name: Generate preview URL | |
id: generate-docs | |
env: | |
FERN_TOKEN: ${{ secrets.FERN_TOKEN }} | |
run: | | |
cd docs-site | |
OUTPUT=$(fern generate --docs --preview 2>&1) || true | |
echo "$OUTPUT" | |
URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()') | |
echo "preview_url=$URL" >> $GITHUB_OUTPUT | |
- name: Update or Create Preview Comment | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const workspace = process.env.GITHUB_WORKSPACE; | |
const { updatePreviewComment } = await import(`${workspace}/docs/scripts/preview-comment.js`); | |
await updatePreviewComment({ | |
github, | |
context, | |
previewUrl: '${{ steps.generate-docs.outputs.preview_url }}' | |
}); |