Skip to content

Commit 9ac4af2

Browse files
committed
Enable users to manually trigger a deployment from target branch
When testing on a fork I want to be able to push to a non-main branch and deploy that, rather than force-pushing to main, which is a bad habit to get into. Signed-off-by: Robert Young <[email protected]>
1 parent b49653c commit 9ac4af2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
11+
inputs:
12+
branch:
13+
description: 'The branch to checkout'
14+
required: true
15+
default: 'main'
16+
type: string
1117

1218
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1319
permissions:
@@ -33,9 +39,11 @@ jobs:
3339
- 5000:5000
3440
steps:
3541
- name: Checkout
36-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
43+
with:
44+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref_name }}
3745
- name: Setup Pages
38-
uses: actions/configure-pages@v3
46+
uses: actions/configure-pages@v5
3947

4048
- name: Set up Docker Buildx
4149
uses: docker/setup-buildx-action@v3

0 commit comments

Comments
 (0)