generated from open-ephys/doc-template
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (48 loc) · 1.56 KB
/
sphinx-build.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
name: Update Documentation
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1. Generate HTML files
- name: Check out repository code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v1
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
- name: Make
run: |
pipenv run make html
# 2. Add and commit HTML files to gh-pages branch
- name: Commit documentation changes
run: |
git clone https://github.com/open-ephys/commutator-docs.git --branch gh-pages --single-branch gh-pages
cp -r docs/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# 3. Push changes to gh-pages branch (updates documentation page)
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}