ReMe/.github/workflows/_build-docs.yml
jinliyl d529ec5256
feat(studio): add bilingual browser demo to documentation site (#581)
* feat(studio): add bilingual browser demo to documentation site

* fix(studio): preserve literal wikilinks during Markdown parsing

* fix(studio): preserve Markdown references and escaped wikilinks
2026-10-03 22:34:11 +08:00

80 lines
2.2 KiB
YAML

name: _Build documentation
on:
workflow_call:
inputs:
run_tests:
description: Run the documentation test suite before building
required: false
default: true
type: boolean
upload_pages_artifact:
description: Upload the build for a later GitHub Pages deployment job
required: false
default: false
type: boolean
permissions:
contents: read
jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: github-pages
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '22.22.3'
cache: npm
cache-dependency-path: |
github-pages/package-lock.json
reme_studio/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install Studio dependencies
run: npm ci --prefix ../reme_studio
- name: Check Studio types and lint
if: inputs.run_tests
working-directory: reme_studio
run: npm run format:check && npm run lint
- name: Test browser demo behavior
if: inputs.run_tests
working-directory: reme_studio
run: node --test tests/demo-workspace.test.mjs tests/wikilinks.test.mjs
- name: Run tests
if: inputs.run_tests
run: npm test
- name: Build documentation
run: npm run build
- name: Verify browser demo bundle
if: inputs.run_tests
working-directory: reme_studio
run: node --test tests/demo-build.test.mjs
- name: Configure Pages
if: inputs.upload_pages_artifact
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
- name: Upload Pages artifact
if: inputs.upload_pages_artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: github-pages/dist