Skip to content

Commit 289c9ee

Browse files
authored
Merge pull request #389 from jGaboardi/docs_action
add docs action workflow
2 parents 66905ad + d47143d commit 289c9ee

File tree

473 files changed

+126
-97458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+126
-97458
lines changed

.github/workflows/build_docs.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
2+
name: Build Docs
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
workflow_dispatch:
9+
inputs:
10+
version:
11+
description: Manual Doc Build Reason
12+
default: test
13+
required: false
14+
15+
jobs:
16+
docs:
17+
name: Build & Push Docs
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 90
20+
strategy:
21+
matrix:
22+
os: ['ubuntu-latest']
23+
environment-file: [ci/38.yaml]
24+
experimental: [false]
25+
defaults:
26+
run:
27+
shell: bash -l {0}
28+
29+
steps:
30+
- name: Checkout repo
31+
uses: actions/checkout@v2
32+
33+
- name: Setup micromamba
34+
uses: mamba-org/provision-with-micromamba@main
35+
with:
36+
environment-file: ${{ matrix.environment-file }}
37+
micromamba-version: 'latest'
38+
39+
- name: Make Docs
40+
run: cd docs; make html
41+
42+
- name: Commit Docs
43+
run: |
44+
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
45+
cp -r docs/_build/html/* gh-pages/
46+
cd gh-pages
47+
git config --local user.email "[email protected]"
48+
git config --local user.name "GitHub Action"
49+
git add .
50+
git commit -m "Update documentation" -a || true
51+
# The above command will fail if no changes were present,
52+
# so we ignore the return code.
53+
54+
- name: push to gh-pages
55+
uses: ad-m/github-push-action@master
56+
with:
57+
branch: gh-pages
58+
directory: gh-pages
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
force: true

ci/38.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ dependencies:
1919
- xarray
2020
- joblib
2121
- zstd
22+
# for docs build action (this env only)
23+
- nbsphinx
24+
- numpydoc
25+
- sphinx>=1.4.3
26+
- sphinxcontrib-bibtex<2.0.0
27+
- sphinx_bootstrap_theme
28+

docsrc/Makefile renamed to docs/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You can set these variables from the command line.
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
7-
SPHINXPROJ = PACKAGE_NAME
7+
SPHINXPROJ = libpysal
88
SOURCEDIR = .
99
BUILDDIR = _build
1010

@@ -17,15 +17,18 @@ help:
1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20+
@rsync -r --exclude '.ipynb_checkpoints/' ../notebooks/ ./notebooks/
2021
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2122

2223
github:
2324
@make html
2425

2526
sync:
26-
@rsync -avh --exclude '.nojekyll' _build/html/ ../docs/ --delete
27+
@rsync -avh _build/html/ ../docs/ --delete
2728
@make clean
29+
touch .nojekyll
2830

2931
clean:
3032
rm -rf $(BUILDDIR)/*
3133
rm -rf auto_examples/
34+
rm -rf generated/
-9.1 KB
Binary file not shown.
-34.5 KB
Binary file not shown.
-39.2 KB
Binary file not shown.
-17.1 KB
Binary file not shown.
-18.2 KB
Binary file not shown.
-64.3 KB
Binary file not shown.
-10.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)