Skip to content

Commit

Permalink
Merge pull request #26 from sphinx-notes/feat/chekcout-options
Browse files Browse the repository at this point in the history
Add checkout options
  • Loading branch information
SilverRainZ authored Mar 25, 2023
2 parents 9845920 + 9d55db6 commit b29e0dd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
30 changes: 26 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ __ https://docs.github.com/en/pages/getting-started-with-github-pages/configurin
Inputs
======

========================== ============================ ======== ==============================================
========================== ============================ ======== =================================================
Input Default Required Description
-------------------------- ---------------------------- -------- ----------------------------------------------
-------------------------- ---------------------------- -------- -------------------------------------------------
``documentation_path`` ``./docs`` false Path to Sphinx source files
``requirements_path`` ``./docs/requirements.txt`` false Path to to requirements file,
used in ``pip install -r XXX`` command
``pyproject_extras`` ``docs`` false Extras of `Requirement Specifier`__
used in ``pip install .[XXX]``
``python_version`` ``3.10`` false Version of Python
``sphinx_version`` ``5.3`` false Version of Sphinx
``sphinx_build_options`` ```` false Additional options passed to ``sphinx-build``
``sphinx_build_options`` false Additional options passed to ``sphinx-build``
``cache`` ``false`` false Enable cache to speed up documentation building
========================== ============================ ======== ===============================================
``checkout`` ``true`` false Whether to automatically checkout the repository,
if false, user need to do it byself
========================== ============================ ======== =================================================

__ https://pip.pypa.io/en/stable/reference/requirement-specifiers/#overview

Expand Down Expand Up @@ -119,3 +121,23 @@ For non-python dependencies, add a step to your workflow file, and install them
(such as apt, wget, ...). See `#24`__ for example.

__ https://github.com/sphinx-notes/pages/issues/24

Customize checkout options
**************************

Repository is automatically checkout by default, but some user may need to customize checkout options
(For example, checkout private repository, checkout multiple repositories).
For this case, user can set the ``checkout`` options to ``false``, then use `action/checkout`__ byeself.

.. code:: yaml
steps:
- uses: actions/checkout@master
with:
YOUR_CUSTOM_OPTIONS: ...
- id: deployment
uses: sphinx-notes/pages@v3
with:
checkout: false
__ https://github.com/actions/checkout
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ inputs:
description: 'Additional options passed to sphinx-build'
required: false
default: ''
checkout:
description: 'Whether to automatically checkout the repository, if false, user need to do it byself'
required: false
default: true
outputs:
page_url:
description: 'URL to deployed GitHub Pages'
Expand All @@ -44,12 +48,12 @@ runs:
steps:
- name: Checkout
uses: actions/checkout@v3
if: ${{ inputs.cache == 'true' }}
if: ${{ inputs.chekcout == 'true' && inputs.cache == 'true' }}
with:
fetch-depth: 0 # Required by git-restore-mtime
- name: Checkout
uses: actions/checkout@v3
if: ${{ inputs.cache == 'false' }}
if: ${{ inputs.chekcout == 'true' && inputs.cache == 'false' }}

- name: Setup python
uses: actions/setup-python@v4
Expand Down

0 comments on commit b29e0dd

Please sign in to comment.