Merge pull request #22 from PythonWoods/release/v0.5.0a1-final-v2 #27
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
| # SPDX-FileCopyrightText: 2026 PythonWoods <dev@pythonwoods.dev> | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Deploy Documentation to Cloudflare Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release/**' | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - 'README.md' | |
| - 'CHANGELOG.md' | |
| - 'SECURITY.md' | |
| - 'noxfile.py' | |
| - '.github/workflows/deploy-docs.yml' | |
| # Trigger on tags regardless of paths changed | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'mkdocs.yml' | |
| - 'README.md' | |
| - 'CHANGELOG.md' | |
| - 'SECURITY.md' | |
| - 'noxfile.py' | |
| - '.github/workflows/deploy-docs.yml' | |
| workflow_dispatch: # Manual trigger | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| UV_SYSTEM_PYTHON: 0 | |
| PYTHONUNBUFFERED: 1 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-suffix: "docs" | |
| - name: Set up Python 3.11 | |
| run: uv python install 3.11 | |
| - name: Install Dependencies | |
| run: uv sync --group dev | |
| - name: Download Lucide Icons | |
| run: | | |
| mkdir -p overrides/.icons/lucide | |
| ASSET_URL=$(curl -sf https://api.github.com/repos/lucide-icons/lucide/releases/latest \ | |
| | python3 -c "import sys,json; r=json.load(sys.stdin); print(next(a['browser_download_url'] for a in r['assets'] if a['name'].startswith('lucide-icons') and a['name'].endswith('.zip')))") | |
| curl -sL "$ASSET_URL" -o /tmp/lucide.zip | |
| unzip -q /tmp/lucide.zip "*.svg" -d /tmp/lucide-extracted | |
| find /tmp/lucide-extracted -name "*.svg" -exec cp {} overrides/.icons/lucide/ \; | |
| - name: Package Brand Kit | |
| run: | | |
| mkdir -p docs/assets | |
| cd docs/assets/brand | |
| zip -r ../brand-kit.zip . | |
| - name: Build Documentation | |
| run: uv run mkdocs build --strict | |
| - name: Deploy to Cloudflare Pages | |
| # Allow deploy on push to main, workflow_dispatch, or version tags | |
| if: | | |
| (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && | |
| (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| # Use 'main' as the production branch for Cloudflare regardless of tag name | |
| command: pages deploy site --project-name=zenzic --branch=main --commit-dirty=true |