From 2e35f8c8fb9b80fa63e4c0297ca3611957e71d4b Mon Sep 17 00:00:00 2001 From: Sen Huang <48879559+ployts@users.noreply.github.com> Date: Thu, 12 Sep 2024 11:36:48 +0800 Subject: [PATCH] sphinxdoc deploy (#2) * fix sphinxdoc yaml * fix link to doc --------- Co-authored-by: hs --- .github/workflows/deploy_sphinx_docs.yml | 62 +++++++++++++++++++++--- README.md | 6 +-- README_ZH.md | 6 +-- docs/sphinx_doc/requirements.txt | 1 - 4 files changed, 61 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy_sphinx_docs.yml b/.github/workflows/deploy_sphinx_docs.yml index d1918737..8309017b 100644 --- a/.github/workflows/deploy_sphinx_docs.yml +++ b/.github/workflows/deploy_sphinx_docs.yml @@ -1,4 +1,4 @@ -name: Deploy Sphinx documentation to Pages +name: deploy-sphinx-documentation-to-pages on: pull_request: @@ -15,16 +15,63 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.python-version }} + - name: Setup Python uses: actions/setup-python@master with: - python_version: ${{ matrix.python-version }} - - name: Install dependencies + python-version: '3.10' + - name: Choose Pandoc + shell: bash + run: | + case $RUNNER_OS in + "Linux") + printf 'INSTALLER_SUFFIX=1-amd64.deb' >> $GITHUB_ENV + ;; + "macOS") + printf 'INSTALLER_SUFFIX=macOS.pkg' >> $GITHUB_ENV + ;; + *) + printf 'Do not know how to install pandoc on %s\n' "$RUNNER_OS" + exit 1 + ;; + esac + - name: Download Pandoc + shell: bash + env: + GITHUB_TOKEN: ${{ github.token }} + REPO: jgm/pandoc + DOWNLOAD_URL: 'https://github.com/jgm/pandoc/releases/download/' + run: | + gh release download ${{ inputs.version }} \ + --repo "$REPO" \ + --pattern '*'${{ env.INSTALLER_SUFFIX }} + printf 'INSTALLER_VERSION=%s' \ + "$(ls pandoc-*-${{ env.INSTALLER_SUFFIX }} | \ + sed 's/pandoc-\([0-9.]*\)-.*/\1/')" \ + >> $GITHUB_ENV + - name: Install Pandoc + shell: bash + env: + INSTALLER: pandoc-${{ env.INSTALLER_VERSION }}-${{ env.INSTALLER_SUFFIX }} + run: | + case $RUNNER_OS in + "Linux") + sudo apt install ./$INSTALLER + ;; + "macOS") + sudo installer -pkg ./$INSTALLER -target '/' + ;; + *) + echo "$RUNNER_OS not supported" + exit 1 + ;; + esac + rm $INSTALLER + - name: Install Sphinx Dependencies run: | python -m pip install --upgrade pip + pip install -r requirements.txt pip install -r docs/sphinx_doc/requirements.txt - - id: build - name: Build Documentation + - name: Build Documentation run: | cd docs/sphinx_doc bash build_sphinx_doc.sh @@ -33,7 +80,8 @@ jobs: with: name: SphinxDoc path: 'docs/sphinx_doc/build/html' - - uses: peaceiris/actions-gh-pages@v3 + - name: Push Pages + uses: peaceiris/actions-gh-pages@v3 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index f08340b2..30959776 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ Equip your LLM chatbot with a powerful and flexible long term memory system. [![](https://img.shields.io/badge/python-3.10+-blue)](https://pypi.org/project/memoryscope/) [![](https://img.shields.io/badge/pypi-v0.1.1.0-blue?logo=pypi)](https://pypi.org/project/memoryscope/) [![](https://img.shields.io/badge/license-Apache--2.0-black)](./LICENSE) -[![](https://img.shields.io/badge/Docs-English%7C%E4%B8%AD%E6%96%87-blue?logo=markdown)](https://modelscope.github.io/memoryscope/#welcome-to-memoryscope-tutorial-hub) -[![](https://img.shields.io/badge/Docs-API_Reference-blue?logo=markdown)](https://modelscope.github.io/memoryscope/) -[![](https://img.shields.io/badge/Contribute-Welcome-green)](https://modelscope.github.io/memoryscope/tutorial/contribute.html) +[![](https://img.shields.io/badge/Docs-English%7C%E4%B8%AD%E6%96%87-blue?logo=markdown)](https://modelscope.github.io/MemoryScope/en/index.html#welcome-to-memoryscope-tutorial) +[![](https://img.shields.io/badge/Docs-API_Reference-blue?logo=markdown)](https://modelscope.github.io/MemoryScope/en/docs/api.html) +[![](https://img.shields.io/badge/Contribute-Welcome-green)](https://modelscope.github.io/MemoryScope/en/docs/contribution.html) ---- ## 📰 News diff --git a/README_ZH.md b/README_ZH.md index cc975cd5..6785027d 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -9,9 +9,9 @@ [![](https://img.shields.io/badge/python-3.10+-blue)](https://pypi.org/project/memoryscope/) [![](https://img.shields.io/badge/pypi-v0.1.1-blue?logo=pypi)](https://pypi.org/project/memoryscope/) [![](https://img.shields.io/badge/license-Apache--2.0-black)](./LICENSE) -[![](https://img.shields.io/badge/Docs-English%7C%E4%B8%AD%E6%96%87-blue?logo=markdown)](https://modelscope.github.io/memoryscope/#welcome-to-memoryscope-tutorial-hub) -[![](https://img.shields.io/badge/Docs-API_Reference-blue?logo=markdown)](https://modelscope.github.io/memoryscope/) -[![](https://img.shields.io/badge/Contribute-Welcome-green)](https://modelscope.github.io/memoryscope/tutorial/contribute.html) +[![](https://img.shields.io/badge/Docs-English%7C%E4%B8%AD%E6%96%87-blue?logo=markdown)](https://modelscope.github.io/MemoryScope/zh/index.html#id1) +[![](https://img.shields.io/badge/Docs-API_Reference-blue?logo=markdown)](https://modelscope.github.io/MemoryScope/zh/docs/api.html) +[![](https://img.shields.io/badge/Contribute-Welcome-green)](https://modelscope.github.io/MemoryScope/zh/docs/contribution.html)