Skip to content

Commit

Permalink
Pass docs folder in inputs to make interface a little nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
ammaraskar committed Dec 24, 2019
1 parent 2e99655 commit 97242e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ jobs:
- uses: actions/checkout@v1
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
args: "docs/ some_other_docs_folder/"
```
* If you have any Python dependencies that your project needs (themes,
build tools, etc) then place them in a requirements.txt file inside your docs
folder.
* If you have multiple sphinx documentation folders, please specify them all in
the `args`.
* If you have multiple sphinx documentation folders, please use multiple
`uses` blocks.

* If you don't want the fancy in-line warnings, just remove the `repo-token` in
the `with` block.
Expand All @@ -56,9 +56,9 @@ example, to invoke sphinx-build directly you can use:
```yaml
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
build-command: "sphinx-build -b html . _build"
args: "docs/"
```

If there's system level dependencies that need to be installed for your
Expand All @@ -67,10 +67,10 @@ build, you can use the `pre-build-command` argument like so:
```yaml
- uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs2/"
repo-token: "${{ secrets.GITHUB_TOKEN }}"
pre-build-command: "apt-get update -y && apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended"
build-command: "make latexpdf"
args: "docs2/"
```

## Running the tests
Expand Down
17 changes: 8 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ branding:
icon: 'book'
color: 'blue'
inputs:
docs-folder:
description:
The folder containing your sphinx docs.
required: true
default: "docs/"
repo-token:
description:
The GITHUB_TOKEN secret.
Needed for status check with in-line warnings and errors.
# This is a horrible hack, we need the default value to be
# ${{ secrets.GITHUB_TOKEN }}
# but, if we put this value there directly then Github actions will try
# to interpolate it and fail.
# So instead, we use an expression that evaluates to the value we want,
# there might be an easier way to do this.
default: ${{ format('${{{{ secrets.GITHUB_TOKEN }}}}') }}
Needed for status check with in-line warnings and errors. Check out the
full README to see how to fill this.
build-command:
description:
The command used to build your documentation (defaults to `make html`)
The command used to build your documentation.
required: false
default: make html
pre-build-command:
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
if not github_env.token:
print("[sphinx-action] Running without repo token")

# The docs directories to build are passed in the arguments.
action.build_all_docs(github_env, sys.argv[1:])
# We build the docs folder passed in the inputs.
action.build_all_docs(github_env, [os.environ.get('INPUT_DOCS-FOLDER')])

0 comments on commit 97242e8

Please sign in to comment.