-
Notifications
You must be signed in to change notification settings - Fork 6
51 lines (42 loc) · 1.39 KB
/
deploy-docs.yml
File metadata and controls
51 lines (42 loc) · 1.39 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
name: Deploy Sphinx Docs to GitHub Pages
on:
push:
branches:
- dev # or your default branch
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -r docs/requirements.txt
- name: Build Sphinx documentation
run: |
cd docs
sphinx-build -M html . _build/
- name: Clone GitHub Pages repo
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git clone https://x-access-token:${{ secrets.GH_PAGES_DEPLOY }}@github.com/nevertools/nevertools.github.io.git gh-pages
env:
GH_PAGES_DEPLOY_TOKEN: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Copy docs to gh-pages/pynever
run: |
rm -rf gh-pages/pynever
mkdir -p gh-pages/pynever
cp -r docs/_build/html/* gh-pages/pynever/
- name: Commit and push changes
run: |
cd gh-pages
git add pynever
git commit -m "Update API docs from pynever" || echo "No changes to commit"
git push origin master