Hexo blog development-deploy to Coding

I. Overview

The blog was previously deployed on Github, but the website is sometimes inaccessible due to network reasons. The solution at this time is to deploy the blog on two servers. Use the project on Github for foreign visits, and use the introduction of this article for domestic visits. Coding on

<!--more-->

Second list

Three configuration SSH

  • Check C:\Users\用户名\whether there is a .ssh folder (if there is, id_rsa.pub is to be set)

  • If not, execute the following command to generate SSH

    ssh-keygen -t rsa -C "your mailbox" 
  • In the next few steps, the system will ask you to enter your password ( Note: If you don't set a password, you can directly press Enter three times )

    Enter passphrase (empty for no passphrase): <Enter password>
    Enter same passphrase again: <Enter password again>

     

 

Four configuration Coding

4.1 Real-name authentication (without real-name authentication, static blog cannot be set up)

  • After logging in on the Cdoing official website , click Team Management in the drop-down list in the upper right corner

     

  • After binding the mobile phone number, real-name authentication can be performed

     

  • Click for real-name authentication, enter your name and ID number

     

 

4.2 Configure SSH

  • Click in the drop-down list in the upper right corner 个人账户设置and find the SSH public key on the left

     

  • Click on the upper right corner 新增公钥, copy all the content in id_rsa.pub to the 公钥内容middle, customize the public key name, and set the period to永久有效

     

4.3 New project

  • When clicked 创建项目, the project template selection page pops up (select DevOps project)

     

  • Fill in the project creation information

     

  • Enter the project you just created, find the warehouse settings, copy the path under SSH (the hexo blog settings will be used)

     

Five configuration hexo blog (_config.yml)

5.1 配置 _config.yml

deploy: #Deployment settings
  type: git
  repository: 
     github: [email protected]:PGzxc/PGzxc.github.io.git (replace your own)
     coding: [email protected]:pgzxc/pgzxc/pgzxc.git (replace your own)

5.2 Execute the hexo command

hexo clean
hexo g
hexo d

 

Six Coding deployment

  • After step 5 is executed, there will be deployed code files under the project

     

  • Click below 持续部署to find the static website from the list (the access address at this time is inaccessible)

     

  • Click the 立即部署button and click the access address again to access normally

     

Seven custom domain names (for those with domain names—Alibaba Cloud domain name resolution)

  • Add the website on coding to the domain name resolution list (it is better to pause the github resolution first, otherwise the resolution will fail)

     

  • In Coding static website—>custom domain name, enter the domain name to be bound, add binding, and force https access

     

Guess you like

Origin blog.csdn.net/Calvin_zhou/article/details/108032031