smalljs$molSearch⌘ KDocsPlaygroundCompareEcosystemAboutEN
DeploymentGetting StartedIntroductionMental modelGetting StartedFrom TypeScript to view.treeProject StructureToolingEssentialsInstallationViewsState & ReactivityRoutingRenderingTestingDeploymentTroubleshootingDataData FetchingData SchemasGiper BazaMoreShowcaseFrom React, Vue & SvelteCookbookAdvancedPluginsModule metadataOfflineGhost viewsAboutFAQTeamReleasesAPI$mol_button_major$mol_button_minor$mol_string$mol_number$mol_text$mol_paragraph$mol_list$mol_row$mol_link$mol_check$mol_switch$mol_select$mol_scroll$mol_page$mol_pick

Deployment

A built $mol app is a folder of static files. There is no server to run, no Node process to keep alive, and no adapter to pick: whatever hosts a folder can host the app.

What you deploy

The build writes everything into the module's -/ folder:1my/hello/-/2├── index.html rewritten for the deployed path3├── web.js the whole app, one file4├── web.css5├── web.locale=en.json one per language6├── manifest.json7└── … anything a `deploy` directive copied inThat folder is the site. Serve it from any static host and the app runs.Everything else in my/hello/ is source, and -/ is generated: the workspace .gitignore ignores -*, so the build output never lands in the project's own history. It reaches the web from the deploy branch instead.

The short version

The scaffolder writes the workflow, so a new project publishes on push:1npx create-view-tree-lsp my/hello2git push.github/workflows/deploy.yml builds the module and pushes my/hello/-/ to the gh-pages branch. GitHub serves that branch once Settings → Pages → Source is Deploy from a branch with gh-pages selected, which is what a repository with a gh-pages branch defaults to. If the URL 404s, that setting is the first thing to check.The site then lives at https://<user>.github.io/<repo>/.

What the workflow actually does

Two actions carry it, and both take a couple of inputs:1- uses: hyoo-ru/mam_build@master22 with:3 package: "my/hello" # the folder to build, workspace-relative4 modules: "app" # which modules inside it to build5 6- uses: hyoo-ru/gh-deploy@v4.4.17 if: github.ref == 'refs/heads/main'8 with:9 folder: "my/hello/app/-"mam_build clones the MAM workspace around your package, resolves the $name tokens in your code into the repositories that hold them, and builds. It needs no lockfile and no npm install step: the registry in .meta.tree is the dependency list, as Project structure describes.gh-deploy commits the built folder to gh-pages. target-folder puts it in a subfolder instead of the root, which is how a branch preview works:1- name: Deploy feature branch2 if: startsWith(github.ref, 'refs/heads/feature/')3 uses: hyoo-ru/gh-deploy@v4.4.14 with:5 folder: "my/hello/app/-"6 target-folder: ${{ github.ref_name }}
Edit this page on GitHubWas this helpful?YesNoPreviousTestingNextTroubleshooting
On this pageWhat you deployThe short versionWhat the workflow actually doesOne file the deploy needsFiles that have to sit at the site rootDeep links on a static hostCheck before you pushBeyond GitHub Pages
Type to search the documentation.