Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc/tutorial #14

Merged
merged 16 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .github/workflows/sphinx_docs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
name: Deploy Sphinx documentation to Pages

on:
pull_request:
types: [opened, synchronize]
paths:
- 'docs/**/*'
push:
branches:
- main

jobs:
pages:
check-approval-and-run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Check for approval
id: check_approval
run: |
# Fetch reviews for the pull request
response=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${GITHUB_REPOSITORY}/pulls/${{ github.event.pull_request.number }}/reviews)

# Count the number of APPROVED reviews
approvals=$(echo "$response" | grep '"state": "APPROVED"' | wc -l)

echo "Approvals: $approvals"

if [ "$approvals" -lt 1 ]; then
echo "No approvals yet."
exit 1
fi

build_tutorial:
needs: check-approval-and-run-script
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -32,19 +53,24 @@ jobs:
- name: Install Dependencies
run: |
pip install -q -e .[full]
- name: Add execute permission to build.sh
run: |
chmod +x docs/tutorial/en/build.sh
- id: build
name: Build Documentation
env:
DASHSCOPE_API_KEY: ${{ secrets.DASHSCOPE_API_KEY }}
run: |
cd docs/sphinx_doc
./build_sphinx_doc.sh
cd docs/tutorial/en/
./build.sh
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: SphinxDoc
path: 'docs/sphinx_doc/build'
path: 'docs/tutorial/en/build'
- uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: 'docs/sphinx_doc/build/html'
publish_dir: 'docs/tutorial/build/html'
cname: doc.agentscope.io
39 changes: 0 additions & 39 deletions .github/workflows/unittest.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ dmypy.json
.DS_Store

# docs
docs/sphinx_doc/build/
docs/tutorial/en/build/

# Used to save loggings and files
*runs/
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ repos:
hooks:
- id: flake8
args: ["--extend-ignore=E203"]
exclude: ^docs
- repo: https://github.com/pylint-dev/pylint
rev: v3.0.2
hooks:
Expand Down
32 changes: 0 additions & 32 deletions docs/sphinx_doc/Makefile

This file was deleted.

12 changes: 0 additions & 12 deletions docs/sphinx_doc/assets/redirect.html

This file was deleted.

4 changes: 0 additions & 4 deletions docs/sphinx_doc/build_sphinx_doc.sh

This file was deleted.

4 changes: 0 additions & 4 deletions docs/sphinx_doc/en/source/_static/custom.css

This file was deleted.

5 changes: 0 additions & 5 deletions docs/sphinx_doc/en/source/_templates/language_selector.html

This file was deleted.

3 changes: 0 additions & 3 deletions docs/sphinx_doc/en/source/_templates/layout.html

This file was deleted.

93 changes: 0 additions & 93 deletions docs/sphinx_doc/en/source/conf.py

This file was deleted.

63 changes: 0 additions & 63 deletions docs/sphinx_doc/en/source/index.rst

This file was deleted.

Loading
Loading