Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] migrate docs build to github actions #1457

Merged
merged 18 commits into from
Nov 25, 2020
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 }}
vfdev-5 marked this conversation as resolved.
Show resolved Hide resolved
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