-
Notifications
You must be signed in to change notification settings - Fork 19
68 lines (59 loc) · 1.96 KB
/
Copy pathdocs.yml
File metadata and controls
68 lines (59 loc) · 1.96 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
60
61
62
63
64
65
66
67
68
name: docs
on:
push:
branches: [master]
paths:
- "docs/**"
- ".github/workflows/docs.yml"
workflow_dispatch:
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Mintlify CLI
run: npm install -g mint
- name: Validate docs (strict)
working-directory: docs
run: mint validate
- name: Build static export
working-directory: docs
run: |
mint export
rm -rf _site
mkdir _site
unzip -q export.zip -d _site
touch _site/.nojekyll
- name: Match code-block font size to body text
# docs.json has no `customCss` and `fonts` has no `code` sub-object
# (verified against settings-appearance docs). Inject a tiny <style>
# block into every page's <head> so fenced code renders at the same
# size as surrounding prose instead of Mintlify's larger default.
working-directory: docs
run: |
python3 - <<'PY'
import pathlib
snippet = (
'<style>pre,pre *{font-size:1em!important;'
'line-height:1.6!important}</style>'
)
for html in pathlib.Path('_site').rglob('*.html'):
s = html.read_text()
if '</head>' in s and snippet not in s:
html.write_text(s.replace('</head>', snippet + '</head>', 1))
PY
- name: Deploy to Agentix-Project.github.io
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.DOCS_DEPLOY_TOKEN }}
external_repository: Agentix-Project/Agentix-Project.github.io
publish_branch: main
publish_dir: docs/_site
force_orphan: true
commit_message: "docs: deploy ${{ github.sha }}"