This repository has been archived by the owner on Oct 22, 2024. It is now read-only.
API docs build #14
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
name: API docs build | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 13 * * *' | |
env: | |
POETRY_VERSION: "1.8.1" | |
PYTHON_VERSION: "3.11" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
path: langchain-api-docs-build | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain | |
ref: bagatur/api_styling | |
path: langchain | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-google | |
path: langchain-google | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-datastax | |
path: langchain-datastax | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-nvidia | |
path: langchain-nvidia | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-cohere | |
path: langchain-cohere | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-elastic | |
path: langchain-elastic | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-postgres | |
path: langchain-postgres | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-aws | |
path: langchain-aws | |
- uses: actions/checkout@v4 | |
with: | |
repository: langchain-ai/langchain-weaviate | |
path: langchain-weaviate | |
- name: Set Git config | |
working-directory: langchain | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Github Actions" | |
- name: Move google libs | |
run: | | |
rm -rf \ | |
langchain/libs/partners/google-genai \ | |
langchain/libs/partners/google-vertexai \ | |
langchain/libs/partners/astradb \ | |
langchain/libs/partners/nvidia-trt \ | |
langchain/libs/partners/nvidia-ai-endpoints \ | |
langchain/libs/partners/cohere \ | |
langchain/libs/partners/elasticsearch \ | |
langchain/libs/partners/upstage \ | |
langchain/libs/standard-tests \ | |
langchain/libs/community \ | |
langchain/libs/experimental | |
mv langchain-google/libs/genai langchain/libs/partners/google-genai | |
mv langchain-google/libs/vertexai langchain/libs/partners/google-vertexai | |
mv langchain-google/libs/community langchain/libs/partners/google-community | |
mv langchain-datastax/libs/astradb langchain/libs/partners/astradb | |
mv langchain-nvidia/libs/ai-endpoints langchain/libs/partners/nvidia-ai-endpoints | |
mv langchain-cohere/libs/cohere langchain/libs/partners/cohere | |
mv langchain-elastic/libs/elasticsearch langchain/libs/partners/elasticsearch | |
mv langchain-postgres langchain/libs/partners/postgres | |
mv langchain-aws/libs/aws langchain/libs/partners/aws | |
mv langchain-weaviate/libs/weaviate langchain/libs/partners/weaviate | |
- name: Rm old html | |
run: | |
rm -rf langchain-api-docs-build/api_reference_build/html | |
- name: Set up Python ${{ env.PYTHON_VERSION }} + Poetry ${{ env.POETRY_VERSION }} | |
uses: "./langchain/.github/actions/poetry_setup" | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
poetry-version: ${{ env.POETRY_VERSION }} | |
cache-key: api-docs | |
working-directory: langchain | |
- name: Install dependencies | |
working-directory: langchain | |
run: | | |
python -m pip install -U uv | |
python -m uv pip install --upgrade --no-cache-dir pip setuptools | |
# skip airbyte and ibm due to pandas dependency issue | |
python -m uv pip install $(ls ./libs/partners | grep -vE "airbyte|ibm" | xargs -I {} echo "./libs/partners/{}") | |
python -m uv pip install libs/core libs/langchain libs/text-splitters | |
python -m uv pip install -r docs/api_reference/requirements.txt | |
- name: Build docs | |
working-directory: langchain | |
run: | | |
python docs/api_reference/create_api_rst.py | |
python -m sphinx -T -E -b html -d ../langchain-api-docs-build/_build/doctrees -c docs/api_reference docs/api_reference ../langchain-api-docs-build/api_reference_build/html -j auto | |
rm -rf ../langchain-api-docs-build/_build/ | |
# https://github.com/marketplace/actions/add-commit | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
cwd: langchain-api-docs-build | |
message: 'Update API docs build' |