Skip to content

GitHub Pages deployment

GitHub Pages deployment is a process that utilizes the hexo-deployer-git plugin to automatically publish generated static websites to a GitHub repository^[600-developer__blog__hexo-blog__create-blog-Hexo.md].

Prerequisites

To enable automated deployment, the hexo-deployer-git package must be installed^[600-developer__blog__hexo-blog__create-blog-Hexo.md].

npm install hexo-deployer-git --save

Configuration

Deployment settings are configured in the project's root _config.yml file^[600-developer__blog__hexo-blog__create-blog-Hexo.md]. This configuration defines the target repository, branch, and other git-specific settings required to push the site content^[600-developer__blog__hexo-blog__create-blog-Hexo.md].

Deployment Process

The deployment workflow involves the following steps^[600-developer__blog__hexo-blog__create-blog-Hexo.md]:

  1. Generate: Run hexo generate to create the static site files in the public/ directory^[600-developer__blog__hexo-blog__create-blog-Hexo.md].
  2. Deploy: Run hexo deploy to publish the generated files to the configured GitHub repository^[600-developer__blog__hexo-blog__create-blog-Hexo.md].

For efficiency, these commands can be combined into a single script entry, such as deploy, defined in package.json^[600-developer__blog__hexo-blog__create-blog-Hexo.md].

  • [[Static Site Generators]]
  • [[Git]]

Sources

^[600-developer__blog__hexo-blog__create-blog-Hexo.md]