Repository navigation
chore: 更新 GitHub Workflows 权限配置 #395
Workflow file for this run
This file contains hidden or 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: Docs Web Site Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| - name: Install the project | |
| run: uv sync --all-extras --all-packages --group dev --group docs | |
| shell: bash | |
| - name: Build API Doc | |
| run: uv run sophia-doc alicebot -o docs/dev-api --anchor-extend --ignore-data --overwrite --exclude-module-name --init-file-name index.md | |
| shell: bash | |
| env: | |
| ALICEBOT_DEV: '1' | |
| - name: Setup Bun | |
| uses: ./.github/actions/setup-bun | |
| - name: Build VitePress site | |
| run: bun run docs:build | |
| - uses: actions/upload-pages-artifact@v4 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy: | |
| needs: build | |
| if: github.event_name != 'pull_request' | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| # Specify runner + deployment step | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |