docs: update GitHub Actions workflow to enhance permissions and improve deployment process for GitHub Pages

This commit is contained in:
ob-yalian
2026-04-24 16:15:17 +08:00
parent ca00143cdd
commit 452fecd6a6
+15 -6
View File
@@ -10,7 +10,9 @@ on:
workflow_dispatch: workflow_dispatch:
permissions: permissions:
contents: write contents: read
pages: write
id-token: write
concurrency: concurrency:
group: gh-pages group: gh-pages
@@ -40,9 +42,16 @@ jobs:
run: | run: |
python docs/build_versions.py python docs/build_versions.py
- name: Deploy to gh-pages branch - name: Upload Pages artifact
uses: peaceiris/actions-gh-pages@v4 uses: actions/upload-pages-artifact@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} path: site
publish_branch: gh-pages
publish_dir: site deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4