-
Notifications
You must be signed in to change notification settings - Fork 0
GitHub Pages Setup
GitHub Action edited this page Aug 24, 2025
·
2 revisions
To enable automatic deployment of the demo app to GitHub Pages, follow these steps:
- Go to your repository on GitHub:
https://github.com/jonmatum/react-mfe-shell - Click on Settings tab
- Scroll down to Pages section in the left sidebar
- Under Source, select GitHub Actions
- Save the settings
Once GitHub Pages is enabled:
- The workflow will automatically trigger on the next push to
main - You can monitor the deployment in the Actions tab
- The demo will be available at:
https://jonmatum.github.io/react-mfe-shell/
-
Triggers: Push to
mainbranch (when demo-related files change) - Manual trigger: Available via workflow_dispatch
-
Steps:
- Checkout code
- Setup Node.js 22
- Install dependencies
- Build library (
npm run build:lib) - Build demo (
npm run build:demo) - Deploy to GitHub Pages
-
Triggers: Pull requests to
mainbranch - Purpose: Test that demo builds successfully before merging
-
Steps:
- Run tests
- Build library
- Build demo
- Report build size
- Pages not enabled: Make sure GitHub Pages is enabled in repository settings
- Workflow permissions: The workflow has the necessary permissions to deploy to Pages
- Build failures: Check the Actions tab for detailed error logs
- Jekyll warning: Can be safely ignored when using GitHub Actions deployment
- Native binding errors: The workflows include fixes for SWC and Rollup native bindings
If you see a warning like:
Actions is currently unavailable for your repository, and your Pages site requires a Jekyll build step
This warning can be safely ignored because:
- We're using GitHub Actions for deployment, not Jekyll
- The workflow will deploy successfully despite this warning
- GitHub Pages will work correctly with our custom deployment process
If you see an error like:
Error: Failed to load native binding
This is caused by cached or incorrect native bindings for SWC. The workflows include a fix:
- Clean install dependencies to avoid cached bindings
- Explicitly reinstall
@swc/coreand@swc/helpers - Remove
package-lock.jsonfor fresh dependency resolution
If you see an error like:
Error: Cannot find module @rollup/rollup-linux-x64-gnu
This is a known npm bug with optional dependencies. The workflows include a fix:
- Remove npm cache to avoid stale dependencies
- Explicitly install the required rollup binary
- Use
--prefer-offlineand--no-auditflags
Common causes and solutions:
- TypeScript errors: Fix type issues in the source code
- Missing dependencies: Ensure all dependencies are in package.json
- Build script issues: Verify build scripts work locally first
- Native binding issues: Clean install usually resolves platform-specific problems
- Go to Actions tab in your repository
- Look for "Deploy Demo App" workflow runs
- Click on a run to see detailed logs
- The deployment URL will be shown in the deploy job
If you want to use a custom domain:
- Add a
CNAMEfile to thepublic/directory with your domain - Configure DNS settings for your domain
- Update the base URL in
vite.config.tsif needed
You can also trigger deployment manually:
- Go to Actions tab
- Select "Deploy Demo App" workflow
- Click "Run workflow"
- Select the
mainbranch - Click "Run workflow"
The demo will be automatically updated whenever you push changes to the main branch that affect the demo or source code.
Pura Vida & Happy Coding!
Getting Started
Design System
Deployment
Reference
Quick Install
npm install @jonmatum/react-mfe-shell