File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : publish site
2- on : # 在什么时候触发工作流
3- push : # 在从本地 main 分支被 push 到 GitHub 仓库时
2+ on :
3+ push :
44 branches :
55 - main
6- pull_request : # 在 main 分支合并别人提的 PR 时
6+ pull_request :
77 branches :
88 - main
9- jobs : # 工作流的具体内容
9+
10+ jobs :
1011 deploy :
11- runs-on : ubuntu-latest # 创建一个新的云端虚拟机,使用最新 Ubuntu 系统
12+ runs-on : ubuntu-latest
1213 steps :
1314 - name : Checkout repository
1415 uses : actions/checkout@v3
1516 with :
16- fetch-depth : 0 # 拉取完整的 Git 历史记录
17+ fetch-depth : 0
1718
1819 - name : Set up Python
1920 uses : actions/setup-python@v4
@@ -24,9 +25,15 @@ jobs: # 工作流的具体内容
2425 run : |
2526 pip install mkdocs-material
2627 pip install mkdocs-git-revision-date-localized-plugin
27- pip install mkdocs-git-committers-plugin-2 # 安装相关插件
28+ pip install mkdocs-git-committers-plugin-2
29+
30+ - name : Build site
31+ run : mkdocs build
32+
33+ - name : Add CNAME file
34+ run : echo "starship.howcam.top" > site/CNAME
2835
2936 - name : Deploy to GitHub Pages
3037 env :
3138 MKDOCS_GIT_COMMITTERS_APIKEY : ${{ secrets.MKDOCS_GIT_COMMITTERS_APIKEY }}
32- run : mkdocs gh-deploy --force # 部署文档到 GitHub Pages
39+ run : mkdocs gh-deploy --force --clean
You can’t perform that action at this time.
0 commit comments