mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
name: Preview Docs
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
run:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
NEXT_PUBLIC_STACK_URL: http://localhost:8101
|
|
NEXT_PUBLIC_STACK_PROJECT_ID: internal
|
|
NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY: internal-project-publishable-client-key
|
|
STACK_SECRET_SERVER_KEY: internal-project-secret-server-key
|
|
SERVER_SECRET: 23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo
|
|
|
|
EMAIL_HOST: 0.0.0.0
|
|
EMAIL_PORT: 2500
|
|
EMAIL_USERNAME: test
|
|
EMAIL_PASSWORD: none
|
|
EMAIL_SENDER: noreply@test.com
|
|
|
|
DATABASE_CONNECTION_STRING: postgres://postgres:password@localhost:5432/stackframe
|
|
DIRECT_DATABASE_CONNECTION_STRING: postgres://postgres:password@localhost:5432/stackframe
|
|
|
|
permissions: write-all
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js v20
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v3
|
|
with:
|
|
version: 9.1.2
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: pnpm build
|
|
|
|
- name: Check API is valid
|
|
run: pnpm run fern check
|
|
|
|
- name: Generate preview URL
|
|
id: generate-docs
|
|
env:
|
|
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
|
|
run: |
|
|
OUTPUT=$(pnpm run 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" > docs_preview_url.untracked.txt
|
|
|
|
- name: Comment URL in PR
|
|
uses: thollander/actions-comment-pull-request@v2.4.3
|
|
with:
|
|
filePath: docs_preview_url.untracked.txt
|