Skip to content

Commit c149f48

Browse files
committed
Add ssh-key input for SSH-based deployments
Pass through an `ssh-key` input to JamesIves/github-pages-deploy-action for both deploy and remove steps. This allows users to authenticate via a deploy key instead of a token, which is useful for cross-repository deployments or environments where SSH is preferred. The input is optional and is a no-op when not provided, preserving existing behavior.
1 parent 6f3a89d commit c149f48

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ inputs:
1616
1717
required: false
1818
default: ${{ github.token }}
19+
ssh-key:
20+
description: >
21+
A private SSH key to use for deployment via SSH, as an alternative to the token. Pass the key from a repository secret. The corresponding public key should be added as a deploy key with write access on the target repository.
22+
23+
Set to `true` to enable SSH endpoints without configuring the SSH client, if SSH has already been set up in a previous step.
24+
required: false
1925
preview-branch:
2026
description: Branch on which the previews will be deployed.
2127
required: false
@@ -157,6 +163,7 @@ runs:
157163
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4.7.4
158164
with:
159165
token: ${{ inputs.token }}
166+
ssh-key: ${{ inputs.ssh-key }}
160167
repository-name: ${{ inputs.deploy-repository }}
161168
branch: ${{ inputs.preview-branch }}
162169
folder: ${{ inputs.source-dir }}
@@ -228,6 +235,7 @@ runs:
228235
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4.7.4
229236
with:
230237
token: ${{ inputs.token }}
238+
ssh-key: ${{ inputs.ssh-key }}
231239
repository-name: ${{ inputs.deploy-repository }}
232240
branch: ${{ inputs.preview-branch }}
233241
folder: ${{ env.empty_dir_path }}

0 commit comments

Comments
 (0)