| name | bryllen-share |
| description | Build the canvas and deploy to GitHub Pages for sharing |
/bryllen-share [project-name] [--dest subpath]
Build the current canvas project and deploy it to GitHub Pages so you can share a live link with others.
Arguments
project-name (optional) — only include this project in the build. If omitted and multiple projects exist, ask the designer.
--dest subpath (optional) — deploy to a subdirectory of the GitHub Pages site instead of root. Useful when the root is reserved for something else (e.g. a landing page). Example: --dest explore deploys to /<repo>/explore/.
Steps
-
Check prerequisites:
-
Determine which project to share.
- If a project name is provided as an argument, use that
- If there are multiple projects in
src/projects/, ask: "Share all projects or just one?"
- If only one project exists, use that
-
Parse arguments. Check if --dest <subpath> was provided. This determines:
- The
--base path for vite
- The
--dest flag for gh-pages
-
Build with the correct base path:
BRYLLEN_PROJECT=<project-name> npx vite build --base=/<repo-name>/
BRYLLEN_PROJECT=<project-name> npx vite build --base=/<repo-name>/explore/
The BRYLLEN_PROJECT env var tells the vite plugin to only include that project's manifest.
-
Deploy to GitHub Pages:
npx gh-pages -d dist
npx gh-pages -d dist --dest explore
-
Enable GitHub Pages if not already enabled:
gh api repos/<owner>/<repo>/pages -X POST -f source.branch=gh-pages -f source.path=/ 2>/dev/null || true
-
Save the share URL to the manifest.
Open src/projects/<project-name>/manifest.ts and set shareUrl on the manifest object:
const manifest: ProjectManifest = {
project: '<project-name>',
shareUrl: 'https://<owner>.github.io/<repo>/',
iterations: [ ... ],
}
If shareUrl already exists, update it. If it doesn't, add it after the project field.
-
Return the URL:
# Without --dest:
Deployed! View at: https://<owner>.github.io/<repo>/
# With --dest:
Deployed! View at: https://<owner>.github.io/<repo>/explore/
Examples
/bryllen-share → all projects, deployed to root
/bryllen-share bryllen-ui → single project, deployed to root
/bryllen-share bryllen-ui --dest explore → single project at /explore/ subpath
Notes
- The
--base flag is critical — without it, asset paths break on GitHub Pages
BRYLLEN_PROJECT filters the build to only include the specified project
--dest uses gh-pages' subdirectory support — it won't overwrite other content on the gh-pages branch
- First deploy may take 1-2 minutes for GitHub to provision the Pages site
- Subsequent deploys update within ~30 seconds
- If the repo is private, only people with repo access can view the page