Files
Leo 90b707a7f1 docs: Keep the doc version in sync with the package official version (#1946)
Closes #1947

## Description

The `Release Docs` action is currently triggered by a tag, but this can
cause it to become unsynchronized with the official package version if
the package fails to publish.

To address this, change the `Release Docs` action to be triggered by the
`Release Crate` workflow. Once that workflow completes successfully, it
will trigger the documentation release, ensuring that the doc version
stays in sync with the official package version.
2026-01-16 10:25:15 +08:00

40 lines
1.0 KiB
YAML

name: Release Docs
on:
workflow_run:
workflows: ["Release Crate"]
types:
- completed
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
- uses: oven-sh/setup-bun@v1
- name: Install
working-directory: docs
run: bun install
- name: Build
working-directory: docs
run: |
bun run build
cp .vitepress/dist/index.html .vitepress/dist/404.html
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "docs/.vitepress/dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4