[fastpages] SSH issues? - SOLVED

Sorry about this, but I can’t quite seem to get this working. Following the initial setup directions I got the secret, the SSH_DEPLOY_KEY, public key, etc in there with how it wants. However after pushing the PR it breaks on Deploy (GitHub Trace Below):

Run peaceiris/actions-gh-pages@v3
[INFO] DeployKey: true
[INFO] PublishBranch: gh-pages
[INFO] PublishDir: ./_site
[INFO] ExternalRepository: 
[INFO] AllowEmptyCommit: false
[INFO] KeepFiles: false
[INFO] ForceOrphan: false
[INFO] UserName: 
[INFO] UserEmail: 
[INFO] CommitMessage: 
[INFO] TagName: 
[INFO] TagMessage: 
[INFO] EnableJekyll (DisableNoJekyll): false
[INFO] CNAME: 

[INFO] setup SSH deploy key
/bin/chmod 700 /home/runner/.ssh
[INFO] wrote /home/runner/.ssh/known_hosts
/bin/chmod 600 /home/runner/.ssh/known_hosts
[INFO] wrote /home/runner/.ssh/github
/bin/chmod 600 /home/runner/.ssh/github
[INFO] wrote /home/runner/.ssh/config
/bin/chmod 600 /home/runner/.ssh/config
/usr/bin/ssh-add /home/runner/.ssh/github
Error loading key "/home/runner/.ssh/github": invalid format
##[error]Action failed with "The process '/usr/bin/ssh-add' failed with exit code 1"

How should I try to go about fixing this?

Edit: just saw the format issues. I went through and copy/pasted just the SSH keys themselves (not the surrounding “ssh starts here” stuff). Should I have not?

@muellerzr here are some examples (which are fake)

Your SECRET should look like this

-----BEGIN RSA PRIVATE KEY-----
MIIJJwIBAAKCAgEAgAcnuGZPQJyCAiSVF+DnQX5CilxBLD+yC/ufkrBTp0CO/C/n
Tym/3H5QIzK95lQCY+bsoABvCs0Kbuyu2f3nqCO1Ot6f2cEsdI3pMVO+2Xw+MiGA
M2t8DI4OWf6hadX2eWq3g3chu3f30IoVDLJ+X/GMMxusWIWEyLIgQuSgbiJwkxUQ
/jW0iCBgmJHdkyKmmXAs5vGY1yBAhtfbO773YVkBOMkoDwADoKBKiYMwFtTDPzXs
ZfVOe0YuG8wQxWOaRcEorvSNMSxRvAVUg1/jnWoYtWRoZ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i1ZGhlLAGiPJkRv3cmpvEbLmVWjYYhUO6eeBrMebrTeGexlhOLIok5IVNSylrJ4HdLqg0n30ytAjtohgRodXdDM/AywIKpuIRUON2JM9eVWAXJRnX/BOHRJKWSVJKvtacG/cJgqCPuU4eRko9/aRWCUcQf5YQJQX1m7PR7K0BbK7LQ7RFOjxgdq1cI66P84iD7O3T+0Fg5Xt44NPtOWY/rNoCqsm9P1W6jDAlFG5TnkFVNhrUC8XDJbWLkovTLMRwWoqEJF7k5vH5KGEhJSfL8NNcIpMKBdrgTEYWWWthLHvCAmYMoper/kmDWvLc+fO9cM/sQhQE/Tv8BkZ27YzX8988WcwguGRREg+3fyPe8JA/KQTWV2cMsN4IUegdmOv+nVpGko3SkG9zqDY5J1Q== 
1 Like

@hamelsmu thank you :slight_smile: In the first, I presume I don’t include the —BEGIN RSA PRIVATE KEY— portion?

No, you can include it. Infact I do include this

Let me try that then :slight_smile:

That actually solved the issue right away! Thank you! (Perhaps it should be included in the directions mabye? Just a one liner include the “—” portion too)

@muellerzr would be honored to have you do a PR

1 Like

Sure, I’d love to! One question though, where are these directions hiding away at?

@muellerzr you can find that here : https://github.com/fastai/fastpages/blob/master/_fastpages_docs/_setup_pr_template.md

1 Like

Sorry it took so long, PR submitted :slight_smile:

1 Like

Merged! :smile:

1 Like

Putting SOLVED in the title is an excellent idea!

2 Likes

Small suggestion - I would add [solved] in tag-like format at the beginning, like I have seen people already adopt for [fastpages]. Makes it easier to know this is metadata, rather than part of the title.
On a similar note, I would make sure all the [fastpages] tags are in the same format (some are [Fastpages]). In the future, you may want to add some functionality that uses these constructs.

Why do we need to do this SSH thing in the first place? Where else are we actually using these keys? I am confused why we need to do this step.

This allows you to commit to a branch as a user other than GitHub Actions, which is the only way to trigger GitHub to deploy your GitHub pages site. But if you are curious, you can try removing it and see what happens!