This articles talks about how to deploy hexo blog to hexo page services without enter username and password.
The key process is to config hexo _config.yml
, and change the deploy
segement.1
2
3
4deploy:
type: git
repo: git@github.com:username/repository-name.github.io.git
branch: master
For more details, step below:
Preface
I assume all the readers have a well configured hexo, and can deploy to Github with typing username and passwords.
Then the below 2 steps for how to deploy without username/passwords.
Generate a ssh key
Commands to generate a ssh key is through ssh-keygen
, like below:
1 | ssh-keygen |
Then copy content from the generated file ~/.ssh/id_rsa.pub
to GitHub.
Config Hexo
After config ssh key to Github, need to change the deploy
part in _config.yml
like below:
1 | deploy: |
while the original content is:
1 | deploy: |