せっかく書くなら公開しないと勿体無いので、Github Pagesに公開してみようと
「LIGさんのブログ記事
」の続きを参考にGithub Pagesにデプロイしてみました。
もくじ
hexo deploy -g でエラー
デプロイしてみると、出力された最後の行は
[info] Deploy done: github
って出てたので「よし公開完了〜」と思ったんですが、
ブラウザで確認するとエラー画面。。
もう一度出力内容をよく見てみると、その上の行で
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
怒られてました。
GithubのSSH接続
しばらくgithub放置していたのでSSHのつなぎ方が分からなくなってた。。
SSH鍵登録しなおして、つないでみるとエラー。
$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
Permission denied (publickey).
~/.ssh/known_hostsのgithub.comと192.30.252.129(↑のエラーメッセージで出たIP)で始まる行を削除した後に
公式ヘルプの下記部分をしてあげたらデプロイできるようになりました。
# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
Agent pid 59566
$ ssh-add ~/.ssh/id_rsa