2.3 KiB
2.3 KiB
Docs site (playground) Docker image + install page
Goal
Publish the Storybook playground as a static "docs" site, package it as a
Docker image (nychthemeron-docs), and add an Installation page documenting
how to install @nychthemeron/library from the private Forgejo npm registry
via npm, pnpm, yarn, and bun.
Install page
- New file:
packages/playground/stories/Install.mdx - Storybook addon-docs MDX page (no story export),
MetatitleGet Started/Installationso it sorts near the top of the sidebar. - Content:
- Heading + short description of the library.
- Registry config snippet (
.npmrc) showing how to point the scoped@nychthemeronregistry athttps://git.mcpeakdev.com/api/packages/mcpeakdev/npm/. - Four code blocks showing install commands for
@nychthemeron/library: npm, pnpm, yarn, bun.
Docker image (nychthemeron-docs)
- New file:
packages/playground/Dockerfile, multi-stage build:- Stage 1 (
oven/bun:1): copy the workspace,bun install --frozen-lockfile, build@nychthemeron/library(cd packages/library && bun run build), then build Storybook (cd packages/playground && bun run build→packages/playground/storybook-static). - Stage 2 (
nginx:alpine): copystorybook-staticinto/usr/share/nginx/html, default nginx config,EXPOSE 80.
- Stage 1 (
- Build context is the repo root (so the workspace lockfile and all packages are available to stage 1).
CI changes
In .forgejo/workflows/ci.yml, add a new publish-docs job:
- Parallel to the existing
publishjob (both depend onbuild). - Gated on
startsWith(github.ref, 'refs/tags/v'). - Steps:
- Checkout
- Log in to
git.mcpeakdev.comusingdocker/login-actionwithsecrets.FORGEJO_TOKEN(same credential as the library publish job). - Extract version from tag (
${GITHUB_REF_NAME#v}). docker/build-push-actionwith context., dockerfilepackages/playground/Dockerfile, pushtrue, tags:git.mcpeakdev.com/mcpeakdev/nychthemeron-docs:<version>git.mcpeakdev.com/mcpeakdev/nychthemeron-docs:latest
Out of scope
- No changes to the existing
buildorpublish(npm) jobs beyond what's already in place. - No SPA routing / custom nginx config — Storybook's static output is served as-is.