poetry 指定python版本 #420
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 Docs | |
on: | |
push: | |
branches: | |
# make sure this is the branch you are using | |
- main | |
jobs: | |
deploy-gh-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# if your docs needs submodules, uncomment the following line | |
# submodules: true | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
# 选择要使用的 node 版本 | |
node-version: '18' | |
- name: Setup pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 6.0.2 | |
- name: Install Deps | |
run: pnpm install | |
- name: Build Docs | |
env: | |
NODE_OPTIONS: --max_old_space_size=8192 | |
# 需要注意的是 github pages的jekyll模版会忽略下划线开头的文件 | |
# 所以要禁用jekyll才能正确加载带下划线的资源 | |
# 可以通过在项目根目录下创建一个名为 .nojekyll 的空文件来禁用jekyll | |
# 关于 -run 和 run | 的区别可参阅: | |
# https://stackoverflow.com/questions/59529042/difference-between-run-and-multiple-runs-in-github-actions | |
run: |- | |
pnpm run docs:build | |
echo > docs/.vuepress/dist/.nojekyll | |
echo google-site-verification: google4ab89117f0f84be9.html > docs/.vuepress/dist/google4ab89117f0f84be9.html | |
# 查看 workflow 的文档来获取更多信息 | |
# @see https://github.com/crazy-max/ghaction-github-pages | |
- name: GitHub Pages | |
uses: crazy-max/[email protected] | |
with: | |
# 部署到 gh-pages 分支 | |
target_branch: gh-pages | |
# 部署目录为 VuePress 的默认输出目录 | |
build_dir: docs/.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 }} |