@@ -7,25 +7,21 @@ Sphinx to GitHub Pages V3
77
88Helps you deploy your Sphinx documentation to Github Pages.
99
10- .. warning :: v3 is **in beta and subject to change**, use v2__ if you need a stable version.
11-
12- __ https://github.com/sphinx-notes/pages/tree/v2
13-
1410Usage
1511=====
1612
13+ We provides two ways for publishing GitHub pages.
14+ The first one is the default but **still in beta **, use the second one if you tend to be stable.
15+
16+ Publishing with this action (default)
17+ ***************************************
18+
17191. `Set the publishing sources to "Github Actions" `__
18- 2. Create workflow:
20+ 2. Create the following workflow:
1921
2022 .. code-block :: yaml
2123
2224 name : Deploy Sphinx documentation to Pages
23-
24- # Runs on pushes targeting the default branch
25- on :
26- push :
27- branches : [master]
28-
2925 jobs :
3026 pages :
3127 runs-on : ubuntu-20.04
4137
4238__ https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow
4339
40+ Publishing from a branch (classical)
41+ ************************************
42+
43+ 1. Create a branch ``gh-pages ``
44+ 2. `Set the publishing sources to "Deploy from a branch" `__, then specify the branch just created
45+ 3. Create the following workflow, in this way user need to publish the site by another action,
46+ we use `peaceiris/actions-gh-pages `__ here:
47+
48+ .. code-block :: yaml
49+
50+ name : Deploy Sphinx documentation to Pages
51+ jobs :
52+ pages :
53+ runs-on : ubuntu-20.04
54+ steps :
55+ - id : deployment
56+ uses : sphinx-notes/pages@v3
57+ with :
58+ publish : false
59+ - uses : peaceiris/actions-gh-pages@v3
60+ with :
61+ github_token : ${{ secrets.GITHUB_TOKEN }}
62+ publish_dir : ${{ steps.deployment.outputs.artifact }}
63+
64+ __ https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-from-a-branch
65+ __ https://github.com/peaceiris/actions-gh-pages
66+
4467Inputs
4568======
4669
@@ -52,24 +75,39 @@ Input Default Required Description
5275 used in ``pip install -r XXX `` command
5376``pyproject_extras `` ``docs `` false Extras of `Requirement Specifier `__
5477 used in ``pip install .[XXX] ``
78+ ========================== ============================ ======== =================================================
79+
80+ Advanced
81+ ********
82+
83+ In most cases you don't need to know about the following inputs.
84+ Unless you need to highly customize the action's behavior.
85+
86+ ========================== ============================ ======== =================================================
87+ Input Default Required Description
88+ -------------------------- ---------------------------- -------- -------------------------------------------------
5589``python_version `` ``3.10 `` false Version of Python
5690``sphinx_version `` ``5.3 `` false Version of Sphinx
5791``sphinx_build_options `` false Additional options passed to ``sphinx-build ``
5892``cache `` ``false `` false Enable cache to speed up documentation building
5993``checkout `` ``true `` false Whether to automatically checkout the repository,
6094 if false, user need to do it byself
95+ ``publish `` ``true `` false Whether to automatically publish the repository
6196========================== ============================ ======== =================================================
6297
6398__ https://pip.pypa.io/en/stable/reference/requirement-specifiers/#overview
6499
65100Outputs
66101=======
67102
68- ======================= ============================
103+ ======================= =========================================================
69104Output Description
70- ----------------------- ----------------------------
71- ``page_url `` URL to deployed GitHub Pages
72- ======================= ============================
105+ ----------------------- ---------------------------------------------------------
106+ ``page_url `` URL to deployed GitHub Pages,
107+ only available when option ``publish `` is set to ``true ``
108+ ``artifact `` Directory where artifact (HTML documentation) is stored,
109+ user can use it to deploy GitHub Pages manually
110+ ======================= =========================================================
73111
74112Examples
75113========
0 commit comments