How to setup my blog?
Goal
Setup personal blog on github.io so that I can share my personal experiences about deep learning, large language model, and AI-infra optimization.
Setup about the blog
To set up this blog, I used the Chirpy Jekyll theme and followed the Jekyll macOS installation guide. Here is a step-by-step record of the setup process.
1. Install Ruby and Jekyll on macOS
macOS comes with a system Ruby, but it’s not recommended for development. Instead, I used Homebrew and chruby to manage a separate Ruby environment.
First, install Homebrew (if not already installed):
1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install chruby and ruby-install:
1
brew install chruby ruby-install
Install the latest stable version of Ruby (e.g., 3.4.1):
1
ruby-install ruby 3.4.1
Configure the shell (e.g., ~/.zshrc) to automatically use chruby:
1
2
3
echo "source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh" >> ~/.zshrc
echo "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrc
echo "chruby ruby-3.4.1" >> ~/.zshrc
Restart the terminal and install Jekyll:
1
gem install jekyll
2. Create the Site Repository
I used the Chirpy Starter template, which simplifies upgrades and isolates unnecessary files:
- Navigate to the Chirpy Starter repository on GitHub.
- Click Use this template -> Create a new repository.
- Name the repository
<username>.github.io(replacing<username>with your GitHub username).
3. Local Environment Setup
Clone the newly created repository to your local machine:
1
2
git clone https://github.com/<username>/<username>.github.io.git
cd <username>.github.io
Install the Ruby dependencies:
1
bundle
4. Run the Local Server
To test the site locally, run the Jekyll server. I used port 4001:
1
bundle exec jekyll serve --port 4001
The site will be available at http://127.0.0.1:4001.
5. Deployment via GitHub Actions
Before deploying, there are a few important prerequisites to check:
- Repository Visibility: If you are on the GitHub Free plan, ensure your site repository is set to Public.
- Platform Lock: If you have committed
Gemfile.lockto your repository and your local machine is not running Linux (e.g., you are on macOS), you must update the platform list of the lock file so GitHub Actions can build it successfully:1
bundle lock --add-platform x86_64-linux - Configuration: Check your
_config.ymlfile and ensure theurlis configured correctly. If you are not using a custom domain and prefer a project site, remember to set thebaseurlto your project name starting with a slash (e.g.,/project-name).
To deploy the site to GitHub Pages:
- Go to your repository Settings on GitHub.
- Click Pages in the left navigation bar.
- Under the Build and deployment section, select GitHub Actions as the source from the dropdown menu.
- Push any commits to GitHub to trigger the Build and Deploy workflow.
- In the Actions tab of your repository, you should see the workflow running. Once the build is complete and successful, the site is live and you can visit the provided URL!
6. TODO
Add more tricks for the blog setup and theme.