Publish Docs to Github Pages #8
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: Publish Docs to Github Pages | |
on: | |
workflow_dispatch: | |
jobs: | |
build-and-deploy-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: latest | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
# cdp-agentkit-core | |
- name: Load cached venv for cdp-agentkit-core | |
id: cached-poetry-dependencies-core | |
uses: actions/cache@v3 | |
with: | |
path: ./cdp-agentkit-core/.venv | |
key: venv-agentkit-${{ runner.os }}-3.10-${{ hashFiles('cdp-agentkit-core/poetry.lock') }} | |
- name: Install dependencies for cdp-agentkit-core | |
if: steps.cached-poetry-dependencies-core.outputs.cache-hit != 'true' | |
run: | | |
cd cdp-agentkit-core | |
poetry install --with dev | |
cd .. | |
- name: Build Sphinx Documentation for cdp-agentkit-core | |
run: | | |
cd cdp-agentkit-core | |
poetry run make docs | |
cd docs | |
poetry run make html | |
cd ../.. | |
mkdir -p docs/cdp-agentkit-core | |
cp -r cdp-agentkit-core/docs/_build/html/* docs/cdp-agentkit-core | |
# cdp-langchain | |
- name: Load cached venv for cdp-langchain | |
id: cached-poetry-dependencies-langchain | |
uses: actions/cache@v3 | |
with: | |
path: ./cdp-langchain/.venv | |
key: venv-langchain-${{ runner.os }}-3.10-${{ hashFiles('cdp-langchain/poetry.lock') }} | |
- name: Install dependencies for cdp-langchain | |
if: steps.cached-poetry-dependencies-langchain.outputs.cache-hit != 'true' | |
run: | | |
cd cdp-langchain | |
poetry install --with dev | |
cd .. | |
- name: Build Sphinx Documentation for cdp-langchain | |
run: | | |
cd cdp-langchain | |
poetry run make docs | |
cd docs | |
poetry run make html | |
cd ../.. | |
mkdir -p docs/cdp-langchain | |
cp -r cdp-langchain/docs/_build/html/* docs/cdp-langchain | |
# twitter-langchain | |
- name: Load cached venv for twitter-langchain | |
id: cached-poetry-dependencies-twitter-langchain | |
uses: actions/cache@v3 | |
with: | |
path: ./twitter-langchain/.venv | |
key: venv-twitter-langchain-${{ runner.os }}-3.10-${{ hashFiles('twitter-langchain/poetry.lock') }} | |
- name: Install dependencies for twitter-langchain | |
if: steps.cached-poetry-dependencies-twitter-langchain.outputs.cache-hit != 'true' | |
run: | | |
cd twitter-langchain | |
poetry install --with dev | |
cd .. | |
- name: Build Sphinx Documentation for twitter-langchain | |
run: | | |
cd twitter-langchain | |
poetry run make docs | |
cd docs | |
poetry run make html | |
cd ../.. | |
mkdir -p docs/twitter-langchain | |
cp -r twitter-langchain/docs/_build/html/* docs/twitter-langchain | |
# deploy | |
- name: Deploy to Github Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
keep_files: false |