Skip to content

Commit

Permalink
Latest.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasofthings committed May 27, 2020
1 parent f38c3c7 commit fd7234d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Container Action Template
# doc-build github action

To get started, click the `Use this template` button on this repository [which will create a new repository based on this template](https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/).
This action build [sphinx](https://www.sphinx-doc.org/) documentation.

For info on how to build your first Container action, see the [toolkit docs folder](https://github.com/actions/toolkit/blob/master/docs/container-action.md).
## Inputs

### `docs`

**Required** The location of the documentation source to build. Default `"docs"`.

### `dest`

**Required** The destination directory. Default `"build"`.

## Example usage

uses: andreasofthings/doc-build@v13
with:
docs: 'docs'
dest: 'build'
11 changes: 8 additions & 3 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,18 @@ def extract_line_information(line_information: str) -> LineInfo:
if __name__=='__main__':
logging.debug("[build documentation] Starting documentation-action build.")

input = os.environ.get("INPUT_DOCS", 'docs')
output = os.environ.get("INPUT_DEST", 'build')

if os.path.exists(os.path.join(input, "requirements.txt")):
import pip
pip.main(['install', "-r", os.path.join(input, "requirements.txt")])


logfile = os.path.join(tempfile.gettempdir(), "sphinx-log")
if os.path.exists(logfile):
os.unlink(logfile)

input = os.environ.get("INPUT_DOCS", 'docs')
output = os.environ.get("INPUT_DEST", 'build')

options = f'--keep-going --no-color -a -q -w {logfile} {input} {output}'

main(options.split(" "))
Expand Down

0 comments on commit fd7234d

Please sign in to comment.