-
Notifications
You must be signed in to change notification settings - Fork 188
78 lines (67 loc) · 2.25 KB
/
docs.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Docs
on:
pull_request:
branches:
- '*'
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
env:
runtime: ~/.local/share/nvim/site/pack/vendor/start
minidoc-git: https://github.com/echasnovski/mini.doc
minidoc-path: ~/.local/share/nvim/site/pack/vendor/start/mini.doc
nvim_url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz
jobs:
docs:
runs-on: ubuntu-latest
name: Generate Docs
steps:
- name: Checkout with token
if: github.event_name != 'pull_request'
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Checkout without token
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
- name: Install neovim and dependencies
run: |
mkdir -p ${{ env.runtime }}
mkdir -p _neovim
curl -sL ${{ env.nvim_url }} | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
git clone --depth 1 ${{ env.minidoc-git }} ${{ env.minidoc-path }}
ln -s $(pwd) ${{ env.runtime }}
- name: Generate API docs
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
make api-docs
- name: Generate plugin docs
uses: kdheepak/[email protected]
with:
vimdoc: obsidian
description: a plugin for writing and navigating an Obsidian vault
pandoc: README.md
toc: false
version: NVIM v0.9.4
demojify: false
dedupsubheadings: false
shiftheadinglevelby: -1
ignorerawblocks: true
- name: Patch plugin docs tag
run: |
# Replace the title tag "*obsidian.txt*" with "*obsidian.nvim*"
sed -i '1 s/obsidian\.txt/obsidian.nvim/' doc/obsidian.txt
- name: Clean up
run: |
rm -rf _neovim/
git status
- uses: stefanzweifel/git-auto-commit-action@v5
if: github.event_name != 'pull_request'
with:
commit_user_name: github-actions[bot]
commit_message: 'chore(docs): auto generate docs'
branch: ${{ github.head_ref }}