88
99
1010name : sphinx
11- on : [push, pull_request]
11+ on : [push, pull_request, workflow_dispatch ]
1212
1313env :
1414 DEFAULT_BRANCH : " main"
@@ -100,14 +100,15 @@ jobs:
100100 - name : Generate PDF
101101 if : ${{ env.GENERATE_PDF == 'true' }}
102102 run : |
103- pip install https://github.com/rkdarst/sphinx_pyppeteer_builder/archive/refs/heads/main.zip
104- make SPHINXOPTS="-t pdf" pyppeteer
103+ #pip install https://github.com/rkdarst/sphinx_pyppeteer_builder/archive/refs/heads/main.zip
104+ pip install sphinx_pyppeteer_builder
105+ make pyppeteer
105106 mv _build/pyppeteer/*.pdf _build/dirhtml/${PDF_FILENAME}
106107
107108 # Stage all deployed assets in _gh-pages/ for simplicity, and to
108109 # prepare to do a multi-branch deployment.
109110 - name : Copy deployment data to _gh-pages/
110- if : ${{ github.event_name == 'push' }}
111+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
111112 run :
112113 rsync -a _build/dirhtml/ _gh-pages/
113114
@@ -116,21 +117,21 @@ jobs:
116117 # https://github.com/coderefinery/gh-pages-multibranch
117118 - name : gh-pages multibranch
118119 uses : coderefinery/gh-pages-multibranch@main
119- if : ${{ github.event_name == 'push' && env.MULTIBRANCH == 'true' }}
120+ if : ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch') && env.MULTIBRANCH == 'true' }}
120121 with :
121122 directory : _gh-pages/
122123 default_branch : ${{ env.DEFAULT_BRANCH }}
123124 publish_branch : gh-pages
124125
125126 # Add the .nojekyll file
126127 - name : nojekyll
127- if : ${{ github.event_name == 'push' }}
128+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
128129 run : |
129130 touch _gh-pages/.nojekyll
130131
131132 # Save artifact for the next step.
132133 - uses : actions/upload-artifact@v4
133- if : ${{ github.event_name == 'push' }}
134+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
134135 with :
135136 name : gh-pages-build
136137 path : _gh-pages/
@@ -142,13 +143,13 @@ jobs:
142143 runs-on : ubuntu-latest
143144 needs : build
144145 # This if can't use the env context - find better way later.
145- if : ${{ github.event_name == 'push' }}
146+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
146147 permissions :
147148 contents : write
148149
149150 steps :
150151 - uses : actions/download-artifact@v4
151- if : ${{ github.event_name == 'push' && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
152+ if : ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch') && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
152153 with :
153154 name : gh-pages-build
154155 path : _gh-pages/
@@ -162,7 +163,7 @@ jobs:
162163 # https://github.com/peaceiris/actions-gh-pages
163164 - name : Deploy
164165 uses : peaceiris/actions-gh-pages@v3
165- if : ${{ github.event_name == 'push' && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
166+ if : ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch') && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
166167 with :
167168 publish_branch : gh-pages
168169 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments