forked from agentscope-ai/agentscope
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (69 loc) · 2.16 KB
/
sphinx_docs.yml
File metadata and controls
76 lines (69 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Deploy Sphinx documentation to Pages
on:
push:
branches:
- main
jobs:
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:
matrix:
os: [ubuntu-latest]
python-version: ['3.9']
env:
OS: ${{ matrix.os }}
PYTHON: '3.9'
steps:
- uses: actions/checkout@master
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Update setuptools
run: |
pip install setuptools==68.2.2 wheel==0.41.2
- 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/tutorial/en/
./build.sh
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: SphinxDoc
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/tutorial/build/html'
cname: doc.agentscope.io