-
Notifications
You must be signed in to change notification settings - Fork 74
47 lines (45 loc) · 1.41 KB
/
docs.yaml
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
name: "Build docs with Sphinx"
on:
push:
branches:
- main
- ci-setup
jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash -l {0} # for conda command
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: gt4sd
environment-file: conda_cpu_linux.yml
auto-activate-base: false
use-only-tar-bz2: true
- name: Build docs
run: |
conda activate gt4sd
pip install --no-deps .
# make sure we can build docs using specific dependencies
pip install "attrs==20.3.0" "markdown-it-py==1.0.0"
cd docs && make html && cd ..
- name: Commit documentation changes
run: |
git clone https://github.com/GT4SD/gt4sd-core.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
touch gh-pages/.nojekyll
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "docs: update documentation." -a || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}