Hexo provides a fast and easy deployment strategy. You only need one single command to deploy your site to your server.
1 | hexo deploy |
To deploy Hexo to Github, you need to install the necessary plugin(s), hexo-deployer-git that is compatible with the deployment method provided by your server/repository. Deployment is usually configured through _config.yml
. A valid configuration must have the type field. For example:
1 | deploy: |
At the beginning, you need to go to this website to see how to create a GitHub Personal Access Token. Once the token is generated, keep it somewhere for later use.
Go to Hexo file _config.yml
, and include below code block in it. Set the token parameter to be the Github token name which was just generated.
1 | deploy: |
After this, you could deploy Hexo to your Github repository. The command should be like this:
1 | <token_name>=<token_value> hexo deploy; |