This guide covers getting started with the blog-build-tools
.
In this Getting Started, you need git
, docker
and docker-compose
.
- Windows: Download & install git.
- Mac: Install it with Homebrew, MacPorts or installer.
- Linux (Ubuntu):
sudo apt-get install git-core
- Windows / Mac
- Linux (Ubuntu)
docker
: https://docs.docker.com/engine/install/ubuntu/docker-compose
: https://docs.docker.com/compose/install/
Make sure the following commands are successful:
$ git
$ docker
$ docker-compose
Clone jpaztech/blog-build-tools repository and copy example blog directory.
$ git clone https://github.com/jpaztech/blog-build-tools.git
$ cp -r blog-build-tools/example {YOUR_WORKING_DIR}/blog
$ cd {YOUR_WORKING_DIR}/blog
$ git init
First, cleanup themes directry.
$ rm -rf themes/*
Add jpazureid/hexo-theme-jpazure blog theme as git submodule
$ git submodule add https://github.com/jpazureid/hexo-theme-jpazure.git themes/jpazure
You can configure most settings here.
$ vim _config.yml
Starts a local server. This is at http://localhost:4000/
.
$ docker-compose up
...
blog_1 | INFO Start processing
blog_1 | INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
To stop server, press Ctrl+C
and docker-compose down
.
^CGracefully stopping... (press Ctrl+C again to force)
Stopping example_blog_1 ... done
$ docker-compose down
In this tutorial, we use GitHub Actions to deploy GitHub Pages.
$ git add .
$ git commit -m 'initial commit'
$ git branch -M main
Create a GitHub repository named {ORG_NAME}/blog
.
Add new remote and Push commits.
$ git remote add origin https://github.com/${ORG_NAME}/blog.git
$ git push -u origin main
The repository has a workflow definition for GitHub Actions (.github/workflows/pages.yml
).
When new changes is pushed to main
branch, the workflow triggered.
The jobs automatically builds blog page and uploads generated files to gh-pages
branch.
You can check workflow runs at Actions
section.
https://github.com/{ORG_NAME}/blog/actions
Once the workflow is finished, the generated pages can be found in the gh-pages
branch of the repository.
To publish the page with GitHub Pages, navigate to GitHub Pages
section in repository Settings
and change Source to gh-pages
branch.