chore: update paper #263
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-pages | |
on: | |
# 每当 push 到 main 或者 gh-pages 分支时触发部署 | |
push: | |
branches: [main, gh-pages] | |
# 手动触发部署 | |
workflow_dispatch: | |
jobs: | |
deploy-pages: | |
runs-on: ubuntu-latest | |
env: | |
NODE_VERSION: '16' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# 初始化 Node.js | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: npm | |
# 安装依赖 | |
- name: Install dependencies | |
run: npm install --frozen-lockfile | |
# 运行构建脚本 | |
- name: Build VuePress site | |
run: npm run build | |
# 查看 workflow 的文档来获取更多信息 | |
# @see https://github.com/crazy-max/ghaction-github-pages | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v2 | |
with: | |
# 部署到 gh-pages 分支 | |
target_branch: gh-pages | |
# 创建 CNAME 绑定域名 | |
fqdn: shao.fun | |
# 创建 .nojekyll 禁用 jekyll | |
jekyll: false | |
# 部署目录为 VuePress 的默认输出目录 | |
build_dir: src/.vuepress/dist | |
env: | |
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |