Update README.md #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: Deploy Hexo Site | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 # 更新到最新版本 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 # 更新到最新版本 | |
with: | |
node-version: '20' # 更新Node.js版本到20 | |
- name: Install dependencies | |
run: | | |
npm install | |
npm install -g hexo-cli # 全局安装Hexo CLI | |
- name: Generate static files | |
run: hexo generate | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.DEPLOY_TOKEN }} | |
publish_dir: ./public |