Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.

Commit a0455eb

Browse files
tkiliasMarleneKress79789Nicoretti
authored
38: Publish documentation for releases to GitHub pages (#39)
* Use sphinx-github-pages-generator for publishing documentation to GitHub pages * Add github workflow to deploy GitHub pages at push to main branch and release * Introduce nox for build tasks Co-authored-by: MarleneKress79789 <marlene.kress@gmx.de> Co-authored-by: Torsten Kilias <tkilias@users.noreply.github.com> Co-authored-by: Nicola Coretti <nico.coretti@gmail.com>
1 parent efb41f3 commit a0455eb

16 files changed

+516
-380
lines changed

.github/workflows/check_github_pages_docs_for_feature_branch.yaml renamed to .github/workflows/check_documentation_build.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
name: Check documentation build and deployment for feature branch
1+
name: Check the documentation build, publish if on main
22

33
on:
44
push:
5+
# Only trigger if branches get pushed (ignored pushed a tag)
6+
tags-ignore:
7+
- '**'
58
branches-ignore:
6-
- main
7-
- github-pages/*
9+
- github-pages/*
810

911
jobs:
1012
create_github_pages_docs:
@@ -27,12 +29,12 @@ jobs:
2729
poetry-version: 1.1.11
2830
- name: Poetry install
2931
run: poetry install
30-
- name: Test documentation deployment for current feature branch
32+
- name: Deploy documentation to github-pages branch
3133
run: |
3234
git config --local user.email "opensource@exasol.com"
3335
git config --local user.name "GitHub Action"
3436
git fetch
35-
SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
36-
TARGET_BRANCH="$(doc/get_target_branch_name.sh "$SOURCE_BRANCH")"
37-
poetry run poe push-html-doc-to-github-pages-current || echo
38-
git push origin --delete "$TARGET_BRANCH"
37+
poetry run python -m nox -s push-pages-current
38+
- name: Cleanup delete target branch
39+
if: ${{ !contains(github.ref, 'main') }}
40+
run: git push -d origin "github-pages/"$(git branch --show-current)""
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
name: Build and push documentation for main branch
1+
name: Generate release documentation
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
release:
5+
types: [published]
76
jobs:
8-
create_github_pages_docs:
7+
8+
publish-release-documentation:
99
strategy:
1010
fail-fast: false
11-
matrix:
12-
python-version: [3.8]
1311
runs-on: ubuntu-latest
1412

13+
environment: publish
14+
1515
steps:
1616
- name: Checkout
1717
uses: actions/checkout@v2
1818
- name: Install python
1919
uses: actions/setup-python@v2
2020
with:
21-
python-version: ${{ matrix.python-version }}
21+
python-version: 3.8
2222
- name: Install poetry
2323
uses: abatilo/actions-poetry@v2.1.4
2424
with:
2525
poetry-version: 1.1.11
2626
- name: Poetry install
2727
run: poetry install
28-
- name: Deploy documentation to github-pages-main branch
28+
- name: Deploy release documentation to github-pages branch
2929
run: |
3030
git config --local user.email "opensource@exasol.com"
3131
git config --local user.name "GitHub Action"
3232
git fetch
33-
poetry run poe push-html-doc-to-github-pages-main
33+
poetry run python -m nox -s push-pages-release
34+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ poetry.lock
136136

137137
# Sphinx
138138
doc/_build
139+
doc/.build-docu
139140
doc/api
140141

141142
# Language container

README.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Or install the wheel directly via::
3131
Documentation
3232
-------------
3333

34-
`Documentation for the latest release <https://exasol.github.io/bucketfs-utils-python/main>`_ is hosted on the Github Pages of this project.
34+
`Documentation for the current main branch <https://exasol.github.io/bucketfs-utils-python/main>`_ is hosted on the Github Pages of this project.
35+
`Here <https://exasol.github.io/bucketfs-utils-python>`_ is a list of documentations for previous releases.
3536

3637
Features
3738
========

doc/Makefile

Lines changed: 0 additions & 30 deletions
This file was deleted.

doc/changes/changes_0.3.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
## Refactoring
1616

1717
- #53: Upgraded Python version to >=3.8, removed numpy from source again
18+
- #38: Replaced old bash scripts for building documentation with Sphinx_Github-Pages-generator, migrated to Nox
1819

1920
## Security
2021

doc/conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
# add these directories to sys.path here. If the directory is relative to the
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
13-
# import os
14-
# import sys
13+
import os
14+
import sys
1515
# sys.path.insert(0, os.path.abspath('.'))
16+
sys.path.insert(0, os.path.abspath('../'))
1617

1718

1819
# -- Project information -----------------------------------------------------
@@ -52,15 +53,15 @@
5253
# List of patterns, relative to source directory, that match files and
5354
# directories to ignore when looking for source files.
5455
# This pattern also affects html_static_path and html_extra_path.
55-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
56+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.build-docu']
5657

5758

5859
# -- Options for HTML output -------------------------------------------------
5960

6061
# The theme to use for HTML and HTML Help pages. See the documentation for
6162
# a list of builtin themes.
6263
#
63-
html_theme = 'alabaster'
64+
html_theme = 'furo'
6465

6566
# Add any paths that contain custom static files (such as style sheets) here,
6667
# relative to this directory. They are copied after the builtin static files,

doc/deploy-to-github-pages-current.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

doc/deploy-to-github-pages-main.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

doc/deploy-to-github-pages.sh

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)