Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyun-wu committed Dec 7, 2024
1 parent bf90f14 commit 169ff96
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/deploy-website-mintlify.yml
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 }}

0 comments on commit 169ff96

Please sign in to comment.