diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..7970d0e2 --- /dev/null +++ b/.github/workflows/pages.yml @@ -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 diff --git a/AGENTS.md b/AGENTS.md index 4a90e5db..48e2ceee 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 + before considering the release complete. + ## Code map - `src/Viewer.tsx`: portal/container lifecycle.