Skip to content

Commit 6018aa8

Browse files
committed
gha - Also handle workflow dispatch among prerelease render & deploy
1 parent 0753c32 commit 6018aa8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ jobs:
4242

4343
- name: Render
4444
uses: quarto-dev/quarto-actions/render@v2
45+
env:
46+
QUARTO_PROFILE: ${{ (inputs.prerelease == 'true' || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease')) && 'prerelease-docs' || '' }}
4547

4648
- name: Publish release website
4749
# Only do this step if
4850
# - workflow is called for release deploy, with inputs.prerelease being false. It should not trigger if inputs.prerelease is null.
4951
# and in GHA null == false is true. That is why we convert to string and compare.
5052
# - workflow is triggered by push event on main branch
51-
if: ${{ format('{0}', inputs.prerelease) == 'false' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
53+
if: ${{ format('{0}', inputs.prerelease) == 'false' || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/main') }}
5254
uses: quarto-dev/quarto-actions/publish@v2
5355
with:
5456
target: netlify
@@ -60,7 +62,7 @@ jobs:
6062
# - workflow is called for release deploy with inputs.prerelease being true. It should not trigger if inputs.prerelease is null.
6163
# Though as in GHA null means false, no need to cast to string
6264
# - workflow is triggered by push event on main branch
63-
if: ${{ inputs.prerelease || (github.event_name == 'push' && github.ref == 'refs/heads/prerelease') }}
65+
if: ${{ inputs.prerelease || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease') }}
6466
id: netlify-deploy
6567
uses: nwtgck/actions-netlify@v3
6668
env:

0 commit comments

Comments
 (0)