Update Gemfile #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Jekyll site to GitHub Pages | |
on: | |
push: | |
branches: | |
- gh-pages # 监控 gh-pages 分支的推送 | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1.4' # 根据需要选择与 GitHub Pages 兼容的 Ruby 版本 | |
bundler-cache: true | |
- name: Install dependencies | |
run: bundle install | |
- name: Build the site | |
run: bundle exec jekyll build --destination _site | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_site | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' # 更新为 Node.js 20 | |