Skip to content

Commit

Permalink
docs: improves doc CI to avoid error occurred when creating PR due to…
Browse files Browse the repository at this point in the history
… permission lacking
  • Loading branch information
tkzt committed Dec 30, 2024
1 parent 16f8f6c commit 38f1407
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,32 @@ on:
pull_request:
branches: [ main ]

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
environment:
name: github-pages
name: Documentation
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Move manager out
run: mv ./manager/* ./
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.12'
cache: true
- name: Install dependencies
run: pdm install -Gdoc
- name: Build documentation
run: pdm run mkdocs build --clean
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: site
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

deploy:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
steps:
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
- name: Build and deploy
run: |
pdm run mkdocs build --clean
# 部署相关步骤...

0 comments on commit 38f1407

Please sign in to comment.