Skip to content
Open
Changes from 4 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
54 changes: 54 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy to GitHub Pages

on:
push:
branches: [main]
workflow_dispatch:

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

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow uses Node.js 20, but the rest of the repo’s CI (e.g. .github/workflows/release.yml) uses Node.js 22. Using a different Node/npm version can cause lockfile or build inconsistencies (especially with Vite). Consider aligning this to the same Node version used elsewhere (or centralizing the version via a shared variable/file) so builds are reproducible across workflows.

Suggested change
node-version: 20
node-version: 22

Copilot uses AI. Check for mistakes.

- name: Install dependencies
working-directory: ./h5
run: npm ci

- name: Build
working-directory: ./h5
run: npx vite build --base /clawapp/
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build command hardcodes --base /clawapp/, which (1) diverges from h5/vite.config.js where base is set to './', and (2) will break for forks/renamed repos where the Pages subpath isn’t /clawapp/. It also implies the app is served from a subpath, but the PWA manifest in vite.config.js currently sets scope/start_url to '/', which can prevent service worker registration under GitHub Pages. Consider deriving the base path from the repository name (or keeping a relative base), and ensure the PWA manifest scope/start_url are consistent with the deployment subpath.

Suggested change
run: npx vite build --base /clawapp/
run: npx vite build

Copilot uses AI. Check for mistakes.

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./h5/dist

deploy:
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@v4
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation in this workflow uses 4 spaces in several sections (e.g. under on, jobs, with), while other workflows in this repo (like .github/workflows/release.yml) use 2-space indentation. YAML is whitespace-sensitive; sticking to one indentation style across workflows reduces the risk of accidental mis-indents in future edits.

Suggested change
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
working-directory: ./h5
run: npm ci
- name: Build
working-directory: ./h5
run: npx vite build --base /clawapp/
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./h5/dist
deploy:
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@v4
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
working-directory: ./h5
run: npm ci
- name: Build
working-directory: ./h5
run: npx vite build --base /clawapp/
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./h5/dist
deploy:
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@v4

Copilot uses AI. Check for mistakes.
Loading