docs: getting started #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: Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "docs/**" | |
| - "tools/trace-ui/**" | |
| - mkdocs.yaml | |
| workflow_dispatch: | |
| concurrency: | |
| group: github-pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: uv sync --group docs | |
| - name: Build static files | |
| run: uv run mkdocs build | |
| # Build trace-ui | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| package_json_file: "tools/trace-ui/package.json" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: latest | |
| cache: "pnpm" | |
| cache-dependency-path: "tools/trace-ui/pnpm-lock.yaml" | |
| - name: Install trace-ui dependencies | |
| working-directory: tools/trace-ui | |
| run: pnpm install --frozen-lockfile | |
| - name: Build trace-ui | |
| working-directory: tools/trace-ui | |
| run: pnpm run build | |
| # Copy trace-ui build to docs site subdirectory | |
| - name: Copy trace-ui to docs | |
| run: | | |
| mkdir -p site/trace-ui | |
| cp -r tools/trace-ui/dist/* site/trace-ui/ | |
| - name: Upload static files as artifact | |
| id: deployment | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: site/ | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| permissions: | |
| pages: write | |
| id-token: write | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |