ブログをGithub Pagesで公開してみた

せっかく書くなら公開しないと勿体無いので、Github Pagesに公開してみようと
LIGさんのブログ記事 」の続きを参考にGithub Pagesにデプロイしてみました。

##hexo deploy -g でエラー

デプロイしてみると、出力された最後の行は

1
[info] Deploy done: github

って出てたので「よし公開完了〜」と思ったんですが、
ブラウザで確認するとエラー画面。。

もう一度出力内容をよく見てみると、その上の行で

1
2
3
4
5
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鍵登録しなおして、つないでみるとエラー。

1
2
3
$ 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)で始まる行を削除した後に

公式ヘルプの下記部分をしてあげたらデプロイできるようになりました。

1
2
3
4
# start the ssh-agent in the background
$ eval "$(ssh-agent -s)"
Agent pid 59566
$ ssh-add ~/.ssh/id_rsa

###参考:
[GitHub] 公開鍵登録の際に、Permission denied (publickey). が出続ける場合の対応 (vagrantからsshする場合の注意も)