Skip to content

docs: migrate our API docs to zensical (#7071) #2132

docs: migrate our API docs to zensical (#7071)

docs: migrate our API docs to zensical (#7071) #2132

name: Upload Benchmarks
on:
push:
branches:
- main
workflow_call:
inputs:
tag:
description: 'Tagged commit to upload (e.g., v1.2.3). Leave empty for main branch.'
required: false
type: string
workflow_dispatch:
inputs:
tag:
description: 'Tagged commit to upload (e.g., v1.2.3). Leave empty for main branch.'
required: false
type: string
jobs:
upload_benchmarks:
runs-on: ubuntu-latest
steps:
- name: Determine ref
if: inputs.tag != ''
id: ref
run: |
TAG="${{ inputs.tag }}"
echo "ref=refs/tags/${TAG}" >> $GITHUB_OUTPUT
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ steps.ref.outputs.ref || 'refs/heads/main' }}
- name: Use Node.js from nvmrc
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4
with:
node-version-file: '.nvmrc'
- name: Install
run: npm ci
- name: Build benchmarks
run: |
npm run generate-typings
npm run build-benchmarks
- name: Copy benchmarks_generated.js
run: |
mkdir tmp
cp test/bench/versions/benchmarks_generated.js tmp
cp test/bench/versions/benchmarks_generated.js.map tmp
- name: Upload to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: tmp
destination_dir: benchmarks/${{ inputs.tag || 'main' }}
commit_message: 'deploy: ${{ inputs.tag }}'