11name : " Pull Request Docs Check"
22on :
3- - pull_request
3+ pull_request :
44
55jobs :
66 docs :
77 runs-on : ubuntu-latest
88 steps :
9- - uses : actions/checkout@v1
10- - uses : ammaraskar/sphinx-action@master
11- with :
12- docs-folder : " docs/"
13-
14- - uses : actions/upload-artifact@v3
15- with :
16- name : DocumentationHTML
17- path : docs/_build/html/
18-
19- - name : Commit documentation changes
20- run : |
21- git clone https://github.com/your_git/repository.git --branch gh-pages --single-branch gh-pages
22- cp -r docs/_build/html/* gh-pages/
23- cd gh-pages
24- git config --local user.email "[email protected] " 25- git config --local user.name "GitHub Action"
26- git add .
27- git commit -m "Update documentation" -a || true
28- # The above command will fail if no changes were present, so we ignore
29- # the return code.
30- - name : Push changes
31- uses : ad-m/github-push-action@master
32- with :
33- branch : gh-pages
34- directory : gh-pages
35- github_token : ${{ secrets.GITHUB_TOKEN }}
9+ - uses : actions/checkout@v2 # Updated to v2
10+
11+ - name : Set up Python
12+ uses : actions/setup-python@v2
13+ with :
14+ python-version : ' 3.x' # Specify the Python version you need
15+
16+ - name : Install dependencies
17+ run : |
18+ python -m pip install --upgrade pip
19+ pip install sphinx
20+ pip install -r docs/requirements.txt # Ensure you have a requirements file for Sphinx
21+
22+ - name : Build documentation
23+ run : |
24+ sphinx-build docs docs/_build/html
25+
26+ - uses : actions/upload-artifact@v3
27+ with :
28+ name : DocumentationHTML
29+ path : docs/_build/html/
30+
31+ - name : Commit documentation changes
32+ run : |
33+ git clone https://github.com/shankarpandala/lazypredict.git --branch gh-pages --single-branch gh-pages
34+ cp -r docs/_build/html/* gh-pages/
35+ cd gh-pages
36+ git config --local user.email "[email protected] " 37+ git config --local user.name "GitHub Action"
38+ git add .
39+ git commit -m "Update documentation" -a || true
40+ # The above command will fail if no changes were present, so we ignore
41+ # the return code.
42+
43+ - name : Push changes
44+ uses :
ad-m/[email protected] # Updated to a specific version 45+ with :
46+ branch : gh-pages
47+ directory : gh-pages
48+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments