Skip to content

Generate JavaScript entries at build time (#15373) #71

Generate JavaScript entries at build time (#15373)

Generate JavaScript entries at build time (#15373) #71

Workflow file for this run

name: Docs
on:
push:
branches:
- main
paths:
- "packages/**/*.ts"
- "packages/**/*.tsx"
- "scripts/docs.ts"
workflow_dispatch:
inputs:
branch:
description: "Branch to generate docs on"
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs:
if: github.repository == 'remix-run/react-router'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v7
with:
token: ${{ secrets.FORMAT_PAT }}
ref: ${{ github.event.inputs.branch }}
- name: Setup pnpm
uses: pnpm/action-setup@v6.0.9
- name: Setup node
uses: actions/setup-node@v6
with:
node-version-file: ".nvmrc"
cache: pnpm
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Generate Typedoc Docs
run: pnpm run docs:typedoc
- name: Generate Markdown Docs
run: pnpm run docs:jsdoc --write
- name: Commit
run: |
git config --local user.email "hello@remix.run"
git config --local user.name "Remix Run Bot"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "💿 no docs changed"
exit 0
fi
git commit -m "chore: generate markdown docs from jsdocs"
git push
echo "💿 pushed docs changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"