update gh-pages.yml #28
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: Build and Deploy Demo | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv and set Python | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: '3.12' | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| **/uv.lock | |
| - name: Sync project dependencies (uv) | |
| run: | | |
| uv sync --frozen | |
| - name: Render demo to static HTML (uv run) | |
| env: | |
| PYTHONPATH: src | |
| run: | | |
| uv run python -m scripts.ci_render_demo | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Tailwind CLI | |
| run: | | |
| npm install tailwindcss @tailwindcss/cli | |
| - name: Build Tailwind CSS (v4 via @tailwindcss/cli) | |
| run: | | |
| npx @tailwindcss/cli -i dist/input.css -o dist/output.css --minify | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |