Update index.md #261
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: auto deploy | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest # 运行环境为最新版 Ubuntu | |
name: auto deploy | |
steps: | |
# 1. 获取源码 | |
- name: Checkout | |
uses: actions/checkout@v3 # 使用 actions/checkout@v3 | |
with: # 条件 | |
submodules: true # Checkout private submodules(themes or something else). 当有子模块时切换分支? | |
# 2. 配置环境 | |
- name: Setup Node.js 18.12.x | |
uses: actions/setup-node@master | |
with: | |
node-version: "18.12.x" | |
# 3. 生成静态文件 | |
- name: Generate Public Files | |
run: | | |
npm i | |
npm install hexo-cli -g | |
hexo clean && hexo generate | |
# 4. 部署到 GitHub 仓库(可选) | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.DEPLOY_KEY }} | |
external_repository: wndbac/wndbac.github.io | |
publish_branch: gh-pages | |
publish_dir: ./public | |
commit_message: ${{ github.event.head_commit.message }} | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' |