GitHub Pages #20
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: GitHub Pages | |
| on: | |
| workflow_run: | |
| workflows: [CI] | |
| types: [completed] | |
| workflow_dispatch: | |
| permissions: | |
| pages: write | |
| id-token: write | |
| jobs: | |
| e2e: | |
| name: Run E2E tests | |
| if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/playwright:v1.59.1-noble | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install Inkscape | |
| run: apt-get update && apt-get install -y inkscape | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Run E2E tests | |
| run: npm run test:e2e | |
| - name: Run render comparison | |
| run: npm run dev:render-comparison | |
| env: | |
| HOME: /root | |
| - name: Generate TypeScript docs | |
| run: npm run doc:typescript | |
| - name: Assemble pages directory | |
| run: | | |
| mkdir -p pages/e2e pages/demo pages/doc-typescript pages/render-comparison | |
| cp -r e2e/output/* pages/e2e/ | |
| cp -r doc-typescript/* pages/doc-typescript/ | |
| cp -r dev/render-comparison-output/* pages/render-comparison/ | |
| cp e2e/demo.html pages/demo/index.html | |
| cp dist/maplibre.umd.js pages/demo/ | |
| cat > pages/index.html << 'LANDING' | |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>VersaTiles SVG Renderer</title> | |
| <style> | |
| body { font-family: system-ui, sans-serif; max-width: 600px; margin: 4rem auto; padding: 0 1rem; } | |
| a { display: block; margin: 1rem 0; font-size: 1.2rem; } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>VersaTiles SVG Renderer</h1> | |
| <a href="e2e/report.html">E2E Visual Comparison Report</a> | |
| <a href="doc-typescript/index.html">TypeScript API Documentation</a> | |
| <a href="render-comparison/report.html">Label & Icon Rendering Comparison (experimental)</a> | |
| <a href="demo/index.html">MapLibre Plugin Demo</a> | |
| </body> | |
| </html> | |
| LANDING | |
| - name: Upload E2E report artifact | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: e2e-report | |
| path: pages/ | |
| retention-days: 30 | |
| - name: Upload pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: pages/ | |
| deploy: | |
| name: Deploy report to GitHub Pages | |
| needs: e2e | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |