-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (60 loc) · 1.85 KB
/
build_docs.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
name: Build Documentation
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v1
- name: Install pandoc
run: |
sudo wget https://github.com/jgm/pandoc/releases/download/3.1.8/pandoc-3.1.8-1-amd64.deb -O /tmp/pandoc-3.1.8-1-amd64.deb
sudo dpkg -i /tmp/pandoc-3.1.8-1-amd64.deb
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.3.1-0'
environment-file: environment.yml
init-shell: >-
bash
powershell
post-cleanup: 'all'
- name: Set up dependencies
run: |
poetry install --without test,dev --no-root
- name: Install adelie
run: |
pip install -e .
python -c "import adelie"
# Standard drop-in approach that should work for most people.
- name: Build documentation
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git checkout gh-pages
git merge -X theirs origin/main
cd docs
rm -rf _images _sources _static .doctrees generated notebooks *.html *.inv *.js .buildinfo
cd sphinx
make clean && make html
cp -r _build/html/* ..
touch .nojekyll
# Publish built docs to gh-pages branch.
# ===============================
- name: Commit documentation changes
run: |
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore
# that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: docs
github_token: ${{ secrets.ACTIONS_TOKEN }}
# ===============================