[Fix] Bugs where cleanup code is not executed correctly when bot exits #385
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 | |
| paths-ignore: | |
| - 'examples/**' | |
| pull_request: | |
| paths-ignore: | |
| - 'examples/**' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 Node | |
| uses: ./.github/actions/setup-node | |
| - name: Build VitePress site | |
| run: pnpm run docs:build | |
| - uses: actions/upload-pages-artifact@v3 | |
| 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@v4 |