Skip to content

Commit 1db7d96

Browse files
committed
Update deploy workflow to explicitly use SSH key for gh-pages deployment
1 parent 865c0a3 commit 1db7d96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ jobs:
2323
npm run build
2424
2525
- name: Deploy 🚀
26+
env:
27+
# Set GIT_SSH_COMMAND to use the SSH key from secrets
28+
GIT_SSH_COMMAND: "ssh -i ~/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
2629
run: |
30+
# Create the .ssh directory and add the private key
31+
mkdir -p ~/.ssh
32+
echo "${{ secrets.GH_PAGES_DEPLOY_KEY }}" > ~/.ssh/id_rsa
33+
chmod 600 ~/.ssh/id_rsa
34+
2735
git config --global user.name 'github-actions-bot'
2836
git config --global user.email 'support+actions@github.com'
29-
npx gh-pages -d build -r git@github.com:${{ github.repository }}.git
37+
npx gh-pages -d build -r git@github.com:${{ github.repository }}.git

0 commit comments

Comments
 (0)