os: linux language: node_js node_js: - 12 # using nodejs LTS v12 branches: only: - master # only monitor master branch cache: directories: - node_modules # cache node_modules to speed up build process before_script: ## According to your theme and custom configuration, update the script - npm install -g hexo-cli # install Hexo in CI environment - cd themes - git clone https://github.com/next-theme/hexo-theme-next.git next # We do not commit the themes/next folder. Therefore, pull it every time. - cd next - npm install # install next dependencies - cd ../.. # return the root folder - npm install # install the dependencies script: - hexo generate # generate static files deploy: # reference: https://docs.travis-ci.com/user/deployment/pages/ provider: pages skip_cleanup: true # not clean after build token: $GH_TOKEN # the variable you set in last step keep_history: true # fqdn: blog.ne0ng.page # custom domain,delete this field if using username.github.io repo: YoungForest/youngforest.github.io # the repo you want to deploy. If this field is not set manually, the default value is current repo. Sometimes, the site repo is the same with the source files but in different branches. on: branch: master # sources files is in master branch local_dir: public target_branch: master # the branch of generated files. If using `username.github.io` repo, it has to be master. Otherwise, change it to your github pages branch.
把 .travis.yml 文件推送到仓库后,就可以在 Travis CI 中查看构建状态。构建完成后,检查站点仓库并访问博客,确认更新已经发布。