Publish Docs #25
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: Publish Docs | |
| on: | |
| workflow_run: | |
| workflows: ["Build Status"] | |
| branches: [main] | |
| types: [completed] | |
| workflow_dispatch: | |
| permissions: | |
| actions: read | |
| contents: write | |
| jobs: | |
| docs: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-ext/python/setup@main | |
| - name: Download dist from build | |
| uses: actions/download-artifact@v7 | |
| with: | |
| pattern: dist-ubuntu-latest* | |
| merge-multiple: true | |
| path: dist | |
| run-id: ${{ github.event.workflow_run.id }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| repository: ${{ github.repository }} | |
| if: github.event_name == 'workflow_run' | |
| - name: Install from wheel | |
| run: | | |
| uv pip install dist/*.whl | |
| uv pip install yardang | |
| if: github.event_name == 'workflow_run' | |
| - name: Install from source (manual trigger) | |
| run: | | |
| uv pip install .[develop] | |
| uv pip install yardang | |
| if: github.event_name == 'workflow_dispatch' | |
| - run: yardang build | |
| - uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| publish_branch: gh-pages | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: docs/html |