88
99
1010name : sphinx
11- on : [push, pull_request]
11+ on : [push, pull_request, workflow_dispatch ]
1212
1313env :
1414 DEFAULT_BRANCH : " main"
@@ -107,7 +107,7 @@ jobs:
107107 # Stage all deployed assets in _gh-pages/ for simplicity, and to
108108 # prepare to do a multi-branch deployment.
109109 - name : Copy deployment data to _gh-pages/
110- if : ${{ github.event_name == 'push' }}
110+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
111111 run :
112112 rsync -a _build/dirhtml/ _gh-pages/
113113
@@ -116,21 +116,21 @@ jobs:
116116 # https://github.com/coderefinery/gh-pages-multibranch
117117 - name : gh-pages multibranch
118118 uses : coderefinery/gh-pages-multibranch@main
119- if : ${{ github.event_name == 'push' && env.MULTIBRANCH == 'true' }}
119+ if : ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch') && env.MULTIBRANCH == 'true' }}
120120 with :
121121 directory : _gh-pages/
122122 default_branch : ${{ env.DEFAULT_BRANCH }}
123123 publish_branch : gh-pages
124124
125125 # Add the .nojekyll file
126126 - name : nojekyll
127- if : ${{ github.event_name == 'push' }}
127+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
128128 run : |
129129 touch _gh-pages/.nojekyll
130130
131131 # Save artifact for the next step.
132132 - uses : actions/upload-artifact@v4
133- if : ${{ github.event_name == 'push' }}
133+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
134134 with :
135135 name : gh-pages-build
136136 path : _gh-pages/
@@ -142,13 +142,13 @@ jobs:
142142 runs-on : ubuntu-latest
143143 needs : build
144144 # This if can't use the env context - find better way later.
145- if : ${{ github.event_name == 'push' }}
145+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
146146 permissions :
147147 contents : write
148148
149149 steps :
150150 - uses : actions/download-artifact@v4
151- if : ${{ github.event_name == 'push' && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
151+ if : ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch') && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
152152 with :
153153 name : gh-pages-build
154154 path : _gh-pages/
@@ -162,7 +162,7 @@ jobs:
162162 # https://github.com/peaceiris/actions-gh-pages
163163 - name : Deploy
164164 uses : peaceiris/actions-gh-pages@v3
165- if : ${{ github.event_name == 'push' && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
165+ if : ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch') && ( env.MULTIBRANCH == 'true' || github.ref == format('refs/heads/{0}', env.DEFAULT_BRANCH )) }}
166166 with :
167167 publish_branch : gh-pages
168168 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments