Everything works fine after migrating my blog to hexo, it’s just not cool that everytime I have to run hexo deploy to publish my posts. Cool boy uses Travis-CI, right?
Step 1 - generate a personal access token at Github
Go to https://github.com/settings/applications#personal-access-tokens and Generate new token
Step 2 - add an environment variable to your Travis-CI project.
- Go to project Settings and choose Environment Variables
- Variable Name: DEPLOY_REPO
- Variable Value: https://{github_access_token}@github.com/{github_username}/{repository_name}.git (for example: https://8260b82839xx2d19387a51bafca4d5425da7@github.com/ruanyl/ruanyl.github.io.git)
Step 3 - edit .travis.yml file
1 | language: node_js |
Notice! If you have 3rd party themes installed
You have to add the theme repo as a gitmodule, add a file named: .gitmodules under the root dir of your hexo blog and add:
1 | [submodule "alex"] |