chore(ci): update dependencies and add GitHub Actions workflow for syncing plugin documentation

This commit is contained in:
charlie
2025-12-10 14:48:41 +08:00
parent dcf7543299
commit e8d06f6fa8
3 changed files with 467 additions and 259 deletions

49
.github/workflows/build-plugin-docs.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Build and Sync Plugin Docs
on:
workflow_dispatch:
jobs:
build-and-sync-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout logseq repository
uses: actions/checkout@v4
with:
path: logseq
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: logseq/yarn.lock
- name: Install dependencies
working-directory: logseq/libs
run: yarn install --frozen-lockfile
- name: Build documentation
working-directory: logseq/libs
run: yarn build:docs
- name: Checkout plugins repository
uses: actions/checkout@v4
with:
repository: logseq/plugins
token: ${{ secrets.PLUGIN_DOCS_SYNC_TOKEN }}
path: plugins
- name: Sync docs to plugins repository
run: |
cp -r logseq/libs/docs/* plugins/
- name: Commit and push changes
working-directory: plugins
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --staged --quiet || git commit -m "chore: sync plugin docs from logseq/logseq@${{ github.sha }}"
git push