-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf90f14
commit 169ff96
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: docs | ||
on: | ||
pull_request: | ||
branches: [mintlify] | ||
path: | ||
- "autogen/*" | ||
- "website/*" | ||
- ".github/workflows/deploy-website.yml" | ||
push: | ||
branches: [mintlify] | ||
path: | ||
- "autogen/*" | ||
- "website/*" | ||
- ".github/workflows/deploy-website.yml" | ||
workflow_dispatch: | ||
merge_group: | ||
types: [checks_requested] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pydoc-markdown pyyaml termcolor nbconvert | ||
pip install databind.core==4.4.2 databind.json==4.4.2 | ||
- name: Generate API documentation | ||
run: pydoc-markdown | ||
|
||
- name: Convert Jupyter notebooks to MDX | ||
run: | | ||
python process_notebooks.py # Your notebook conversion script | ||
working-directory: docs # Adjust this path | ||
|
||
# Create and switch to mintlify-docs branch | ||
- name: Create documentation branch | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git checkout -b mintlify-docs | ||
# Add and commit the processed files | ||
- name: Commit processed documentation | ||
run: | | ||
git add docs/ # Adjust path as needed | ||
git commit -m "Update processed documentation files" | ||
git push -f origin mintlify-docs | ||
- name: Install Mintlify | ||
run: npm i -g mintlify | ||
|
||
- name: Install dependencies | ||
working-directory: docs | ||
run: npm install | ||
|
||
- name: Deploy to Mintlify | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
mintlify deploy | ||
env: | ||
MINTLIFY_TOKEN: ${{ secrets.MINTLIFY_TOKEN }} |