-
Notifications
You must be signed in to change notification settings - Fork 90
68 lines (67 loc) · 2.47 KB
/
build-docs.yaml
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: "build-docs"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Clone docs repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: Nixtla/docs
ref: scripts
path: docs-scripts
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # 5.3.0
with:
python-version: "3.10"
- name: Build docs
run: |
pip install uv && uv pip install --system ".[all]"
mkdir nbs/_extensions
cp -r docs-scripts/mintlify/ nbs/_extensions/
python docs-scripts/update-quarto.py
nbdev_docs
- name: Apply final formats
run: bash ./docs-scripts/docs-final-formatting.bash
- name: Copy over necessary assets
run: |
cp nbs/mint.json _docs/mint.json
cp docs-scripts/imgs/* _docs/
- name: Configure redirects for gh-pages
run: python docs-scripts/configure-redirects.py mlforecast
- name: Deploy to Mintlify Docs
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs
publish_dir: ./_docs
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Trigger mintlify workflow
if: github.event_name == 'push'
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ secrets.DOCS_WORKFLOW_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'nixtla',
repo: 'docs',
workflow_id: 'mintlify-action.yml',
ref: 'main',
});
- name: Deploy to Github Pages
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./gh-pages
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com