From 8a6a0b9400323130e71ab46ced8258fdc0438542 Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Thu, 19 Dec 2024 06:18:45 +0000 Subject: [PATCH 1/2] Update existing deploy job --- .github/workflows/deploy-website-mintlify.yml | 58 ------------ .github/workflows/deploy-website.yml | 90 +++++++++---------- 2 files changed, 40 insertions(+), 108 deletions(-) delete mode 100644 .github/workflows/deploy-website-mintlify.yml diff --git a/.github/workflows/deploy-website-mintlify.yml b/.github/workflows/deploy-website-mintlify.yml deleted file mode 100644 index 2f657dac7e..0000000000 --- a/.github/workflows/deploy-website-mintlify.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Deploy Mintlify Website - -on: - push: - branches: - - main - paths: - - 'autogen/**' - - 'website/**' - - '.github/workflows/deploy-website-mintlify.yml' - -jobs: - deploy-website-mintlify: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - lfs: true - fetch-depth: 0 - - - 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: Install quarto - uses: quarto-dev/quarto-actions/setup@v2 - - - name: Generate API documentation - run: | - python ./process_api_reference.py - working-directory: website - - - name: Convert Jupyter notebooks to MDX - run: | - python ./process_notebooks.py render - working-directory: website - - - name: Prepare website content - run: | - # Create a temporary directory for filtered content - mkdir -p temp_website - - # Copy files except .ipynb, node_modules, .quarto, and .gitignore - find website -type f -not -path "*/node_modules/*" -not -path "*/.quarto/*" -not -name "*.ipynb" -not -name ".gitignore" -exec cp --parents {} temp_website/ \; - - - name: Deploy to mintlify-pages branch - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: temp_website/website - clean: true # Automatically remove deleted files from the deploy branch diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index 8798fca7ca..eceba50b9a 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -4,14 +4,14 @@ on: pull_request: branches: [main] path: - - "autogen/*" - - "website/*" + - "autogen/**" + - "website/**" - ".github/workflows/deploy-website.yml" push: branches: [main] path: - - "autogen/*" - - "website/*" + - "autogen/**" + - "website/**" - ".github/workflows/deploy-website.yml" workflow_dispatch: merge_group: @@ -29,6 +29,7 @@ jobs: - uses: actions/checkout@v4 with: lfs: true + fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: 18.x @@ -36,36 +37,26 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" - - name: pydoc-markdown install + - name: Install Python dependencies run: | python -m pip install --upgrade pip pip install pydoc-markdown pyyaml termcolor # Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown. pip install databind.core==4.4.2 databind.json==4.4.2 - - name: pydoc-markdown run - run: | - pydoc-markdown - - name: quarto install - working-directory: ${{ runner.temp }} - run: | - wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.23/quarto-1.5.23-linux-amd64.tar.gz - tar -xzf quarto-1.5.23-linux-amd64.tar.gz - echo "$(pwd)/quarto-1.5.23/bin/" >> $GITHUB_PATH - - name: Process notebooks + + - name: Install quarto + uses: quarto-dev/quarto-actions/setup@v2 + + - name: Generate API documentation run: | - python process_notebooks.py render - - name: Test Build + python ./process_api_reference.py + working-directory: website + + - name: Convert Jupyter notebooks to MDX run: | - if [ -e yarn.lock ]; then - yarn install --frozen-lockfile --ignore-engines - yarn build - elif [ -e package-lock.json ]; then - npm ci - npm run build - else - npm i --legacy-peer-deps - npm run build - fi + python ./process_notebooks.py render + working-directory: website + gh-release: if: github.event_name != 'pull_request' runs-on: ubuntu-latest @@ -76,6 +67,7 @@ jobs: - uses: actions/checkout@v4 with: lfs: true + fetch-depth: 0 - uses: actions/setup-node@v4 with: node-version: 18.x @@ -83,39 +75,37 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" - - name: pydoc-markdown install + - name: Install Python dependencies run: | python -m pip install --upgrade pip pip install pydoc-markdown pyyaml termcolor # Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown. pip install databind.core==4.4.2 databind.json==4.4.2 - - name: pydoc-markdown run - run: | - pydoc-markdown - - name: quarto install - working-directory: ${{ runner.temp }} + + - name: Install quarto + uses: quarto-dev/quarto-actions/setup@v2 + + - name: Generate API documentation run: | - wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.23/quarto-1.5.23-linux-amd64.tar.gz - tar -xzf quarto-1.5.23-linux-amd64.tar.gz - echo "$(pwd)/quarto-1.5.23/bin/" >> $GITHUB_PATH - - name: Process notebooks + python ./process_api_reference.py + working-directory: website + + - name: Convert Jupyter notebooks to MDX run: | - python process_notebooks.py render - - name: Build website + python ./process_notebooks.py render + working-directory: website + + - name: Prepare website content run: | - if [ -e yarn.lock ]; then - yarn install --frozen-lockfile --ignore-engines - yarn build - elif [ -e package-lock.json ]; then - npm ci - npm run build - else - npm i --legacy-peer-deps - npm run build - fi + # Create a temporary directory for filtered content + mkdir -p temp_website + + # Copy files except .ipynb, node_modules, .quarto, and .gitignore + find website -type f -not -path "*/node_modules/*" -not -path "*/.quarto/*" -not -name "*.ipynb" -not -name ".gitignore" -exec cp --parents {} temp_website/ \; + - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} # Build output to publish to the `gh-pages` branch: - publish_dir: ./website/build + publish_dir: temp_website/website From e6928f9e0b1c513273311622ea25ceb2fa6026a3 Mon Sep 17 00:00:00 2001 From: Harish Mohan Raj Date: Thu, 19 Dec 2024 06:26:44 +0000 Subject: [PATCH 2/2] Update dependency --- .github/workflows/deploy-website.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index eceba50b9a..95edfad788 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -40,7 +40,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install pydoc-markdown pyyaml termcolor + pip install pydoc-markdown pyyaml termcolor nbconvert # Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown. pip install databind.core==4.4.2 databind.json==4.4.2 @@ -78,7 +78,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install pydoc-markdown pyyaml termcolor + pip install pydoc-markdown pyyaml termcolor nbconvert # Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown. pip install databind.core==4.4.2 databind.json==4.4.2