Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds WebAssembly build support using Emscripten and automatic deployment to GitHub Pages. The changes enable building the project as WASM and deploying a demo to GitHub Pages on every push to the main branch.
Changes:
- Added GitHub Pages deployment workflow with WASM build job
- Configured workflow permissions and concurrency control for Pages deployment
- Set up Emscripten SDK installation and WASM artifact preparation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/ci.yml
Outdated
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
The concurrency configuration is applied at the workflow level, which means it affects all jobs including test and build-wasm jobs on all branches and PRs. This will cause PRs to be blocked if another PR or a push to main is running, even though only the deployment should be serialized. Consider moving this concurrency configuration to only the deploy job where it's actually needed, or use a group name that includes the github.ref context to separate different branches/PRs.
.github/workflows/ci.yml
Outdated
| pages: write | ||
| id-token: write |
There was a problem hiding this comment.
The pages and id-token permissions are granted at the workflow level, which means all jobs (test, minimal, build-wasm, deploy) will receive these elevated permissions. According to the principle of least privilege, only the deploy job needs these permissions. Consider either using a separate workflow for deployment or moving these permissions to the deploy job level using a permissions block within that job.
| cp examples/web/dist/emscripten.js deploy/ | ||
| cp examples/web/dist/emscripten.wasm deploy/ | ||
|
|
||
| - name: Upload Pages artifact |
There was a problem hiding this comment.
The upload-pages-artifact step runs on all workflow triggers (including PRs), but the deployment only happens on pushes to main. This means artifacts are created and uploaded for PRs even though they are never deployed. Consider adding a conditional to the upload step (if: github.event_name == 'push' && github.ref == 'refs/heads/main') to avoid creating unnecessary artifacts, or split the build-wasm job into separate build and upload steps with different conditions.
| - name: Upload Pages artifact | |
| - name: Upload Pages artifact | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
2e23eac to
3590965
Compare
No description provided.