Skip to content

Commit

Permalink
[ci] migrate docs build to github actions (#1457)
Browse files Browse the repository at this point in the history
* Update setup.cfg

* [ci] create docs.yml

* install torch

* [docs] intersphinx update in conf.py

* extract into scripts

* fix path

* fix path

* fix path

* good to go!

* Update docs.yml

* Update install_docs_deps.sh

* Update docs.yml

* Update docs.yml

Co-authored-by: vfdev <[email protected]>
  • Loading branch information
Jeff Yang and vfdev-5 authored Nov 25, 2020
1 parent 3094966 commit 10a0a6e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx-versioning --use-master-conf --use-master-templates build --greatest-tag --whitelist-branches master docs/source docs/build/html
36 changes: 36 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build docs

on:
push:
branches: [master]
tags: ["v*"]
release:
types: [published]

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('docs/requirements.txt') }}

- name: Install docs deps
run: bash .github/workflows/install_docs_deps.sh

- name: Build docs
run: bash .github/workflows/build_docs.sh

- name: deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
publish_branch: gh-pages
commit_message: Deploy pytorch/ignite docs
6 changes: 6 additions & 0 deletions .github/workflows/install_docs_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# remove pkg-resources as it causes failure when installing https://github.com/vfdev-5/sphinxcontrib-versioning
pip uninstall -y pkg-resources setuptools && pip install --upgrade setuptools
pip install torch torchvision -f https://download.pytorch.org/whl/cpu/torch_stable.html -U
pip install -r requirements-dev.txt
pip install -r docs/requirements.txt
pip install git+https://github.com/vfdev-5/sphinxcontrib-versioning.git
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"logo_only": True,
}

html_logo = "_static/img/ignite_logo.svg"
html_logo = "_templates/_static/img/ignite_logo.svg"

html_favicon = "_templates/_static/img/ignite_logomark.svg"

Expand Down Expand Up @@ -188,7 +188,7 @@
# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"https://docs.python.org/": None}
intersphinx_mapping = {"https://docs.python.org/3/": None}

# -- Options for todo extension ----------------------------------------------

Expand Down

0 comments on commit 10a0a6e

Please sign in to comment.