Worktree docs contributing tools #816
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: Documentation | |
| on: | |
| workflow_call: | |
| inputs: | |
| version: | |
| description: 'Version to deploy (e.g. v1.2.3)' | |
| type: string | |
| required: true | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/docs.yaml" | |
| - "docs/**" | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 # Fetch all branches to include 'gh-pages' branch | |
| - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --frozen | |
| - name: Lint Markdown files | |
| uses: DavidAnson/markdownlint-cli2-action@ce4853d43830c74c1753b39f3cf40f71c2031eb9 # v23 | |
| with: | |
| config: 'docs/.markdownlint.jsonc' | |
| globs: 'docs/**/*.md' | |
| - name: Build pages | |
| run: uv run mkdocs build --strict | |
| - name: Configure Git user | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| - name: Deploy pages (unstable) | |
| if: github.ref == 'refs/heads/main' | |
| run: uv run mike deploy --push --update-aliases unstable | |
| - name: Deploy pages (new release) | |
| if: github.event_name == 'workflow_call' | |
| run: | | |
| uv run mike deploy --push --update-aliases ${{ inputs.version }} latest | |
| echo "Deployed version ${{ inputs.version }} to GitHub Pages" |