Skip to content

Commit

Permalink
Merge pull request #3 from naodeng/main
Browse files Browse the repository at this point in the history
update gitHub action config again
  • Loading branch information
naodeng authored Nov 13, 2023
2 parents 207bc58 + 5baf39f commit 028d69f
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: MkDocs Build and Deploy

on:
push:
branches:
- main # 触发构建的分支

jobs:
MkDocs-Build-and-Deploy:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x # 选择合适的 Python 版本

- name: Install dependencies
run: |
pip install -r requirements.txt
mkdocs --version
# 如果你的项目依赖其他 Python 包,可以在这里安装它们

- name: Build MkDocs site
run: |
mkdocs build --clean
mkdocs --version
# 如果你的 MkDocs 配置文件不在根目录,使用 -f 选项指定文件路径,例如:mkdocs build -f path/to/mkdocs.yml

- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v2
with:
path: site

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
path: site
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment

- name: Save build cache
uses: actions/cache/save@v3
with:
key: mkdocs-material-${{ hashfiles('.cache/**') }}
path: .cache

0 comments on commit 028d69f

Please sign in to comment.