Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Deploy demo to GitHub Pages

on:
release:
types:
- published
workflow_dispatch:

concurrency:
group: pages
cancel-in-progress: false

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
name: Build demo
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v7

- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: npm

- name: Verify public npm registry
run: |
test "$(npm config get registry)" = "https://registry.npmjs.org/"
! grep -R "bnpm.byted.org" --include="package-lock.json" .

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Build demo
run: npm run doc

- name: Configure GitHub Pages
uses: actions/configure-pages@v6

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: pages-build

deploy:
name: Deploy demo
needs: build
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
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ npm --prefix ssr-test start

Open `http://127.0.0.1:8005/`. Confirm that the initial HTML is server-rendered and that the viewer becomes interactive after client hydration.

## Releases and GitHub Pages

Publishing a GitHub Release triggers `.github/workflows/pages.yml`. The workflow
builds the demo from the released tag and deploys `pages-build/` through GitHub
Pages. After each release, wait for the Pages workflow and verify
<https://infeng.github.io/react-viewer/> before considering the release complete.

## Code map

- `src/Viewer.tsx`: portal/container lifecycle.
Expand Down