forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.67 KB
/
build-plugin-docs.yml
File metadata and controls
59 lines (49 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build and Sync Plugin Docs
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build-and-sync-docs:
runs-on: ubuntu-latest
# Only run on manual trigger or when the commit message starts with "chore(libs): bump version"
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.head_commit.message, 'chore(libs):bump version')
steps:
- name: Checkout logseq repository
uses: actions/checkout@v4
with:
path: logseq
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10.33.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'pnpm'
cache-dependency-path: logseq/libs/pnpm-lock.yaml
- name: Install dependencies
working-directory: logseq/libs
run: pnpm install --frozen-lockfile
- name: Build documentation
working-directory: logseq/libs
run: pnpm 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