site(play): 3 Story templates (0.3.0 push, PR 4/5) (#112) #94
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: pages | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "site/**" | |
| - "packages/core/**" | |
| - "scripts/build-playground-bundle.mjs" | |
| - ".github/workflows/pages.yml" | |
| workflow_dispatch: | |
| # Top-level permissions are read-only by default for safety. Each job below | |
| # declares the specific writes it needs — this is robust to org policies | |
| # that restrict default token scopes. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: { version: 9.12.0 } | |
| - uses: actions/setup-node@v4 | |
| with: { node-version: "22", cache: "pnpm" } | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm --filter @glyph/core run build | |
| - run: node scripts/build-playground-bundle.mjs | |
| - name: Verify bundle + schema are fresh (match what build:playground produces) | |
| run: | | |
| # The committed site/play/glyph-bundle.js + site/play/spec.schema.json | |
| # should both be byte-identical to what `pnpm run build:playground` | |
| # produces. If either drifts, someone changed @glyph/core (compiler | |
| # output or Zod schemas) and forgot to regenerate the deploy artifacts. | |
| STALE=$(git status --porcelain site/play/glyph-bundle.js site/play/spec.schema.json) | |
| if [ -n "$STALE" ]; then | |
| echo "::error::Generated playground artifacts are stale. Run 'pnpm run build:playground' and commit the result." | |
| echo "$STALE" | |
| git diff --stat site/play/glyph-bundle.js site/play/spec.schema.json | |
| exit 1 | |
| fi | |
| test -s site/play/glyph-bundle.js | |
| test -s site/play/spec.schema.json | |
| - uses: actions/configure-pages@v5 | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |