-
Notifications
You must be signed in to change notification settings - Fork 193
80 lines (67 loc) · 2.94 KB
/
documentation.yml
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
77
78
79
80
name: Documentation
on:
push:
branches:
- release # Trigger the workflow when changes are pushed to the release branch
permissions:
contents: write
actions: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Ensure the Python version is correct
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH # Ensure Poetry's bin directory is in PATH
- name: Install documentation dependencies using Poetry
run: |
cd docs
poetry config virtualenvs.create false # Avoid creating a virtual environment
poetry install --with doc # Install dependencies as specified in pyproject.toml
pip install nest-asyncio # manually install nest-asyncio
pip install torch # manually install torch
# pip install transformers # manually install transformers
poetry show
poetry show adalflow
- name: Build documentation using Makefile
run: |
echo "Building documentation from: $(pwd)"
ls -l # Debug: List current directory contents
poetry run make html # Run Makefile in docs directory to build HTML docs
working-directory: ${{ github.workspace }}/docs
- name: List built documentation
run: |
find ./docs/build/ -type f # List all files in the build directory
working-directory: ${{ github.workspace }}
- name: Create .nojekyll file
run: |
touch .nojekyll # Prevent GitHub Pages from ignoring files that start with an underscore
working-directory: ${{ github.workspace }}/docs/build
- name: Copy CNAME file
run: |
cp ${{ github.workspace }}/CNAME ${{ github.workspace }}/docs/build/CNAME || true
working-directory: ${{ github.workspace }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
publish_branch: gh-pages # Target branch for GitHub Pages deployment
publish_dir: ./docs/build/ # Directory containing the built documentation
user_name: github-actions[bot] # Username for the commit
user_email: github-actions[bot]@users.noreply.github.com # Email for the commit
# Uncomment below for debugging purposes
# - name: Debug Output
# run: |
# pwd # Print the current working directory
# ls -l ./build/ # List files in the build directory
# cat ./source/conf.py # Display the Sphinx configuration file
# working-directory: ${{ github.workspace }}/docs/build