Example repository: a SvelteKit front-end with pnpm, CI and an image
- TypeScript 44.5%
- Dockerfile 31.5%
- HTML 12.8%
- Svelte 11.2%
| .forgejo | ||
| src | ||
| static | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| .prettierignore | ||
| .prettierrc | ||
| Dockerfile | ||
| nginx-default.conf | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| renovate.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
$REPO_OWNER/$REPO_NAME
A static front-end with SvelteKit and pnpm. nginx serves the prerendered pages.
Start
You need Node.js 24 and corepack.
corepack pnpm install
corepack pnpm dev # http://localhost:5173
| Command | What it does |
|---|---|
pnpm lint |
Prettier check |
pnpm check |
Type check with svelte-check |
pnpm test |
Unit tests with Vitest |
pnpm build |
The static site in build/ |
pnpm format |
Format all files |
Pipeline
.forgejo/workflows/ci.yml is the complete pipeline. Copy it and
change it as you need.
| Event | What happens |
|---|---|
| Pull request | Lint, type check, tests and pnpm audit in parallel, then the image is built without a push |
Push to main |
The same, and the image is pushed as <short sha>-main-<run number> |
Tag vX.Y.Z |
Also the image X.Y.Z |
The checks run on the label default, without root. The image build needs Docker, so it runs on
the label vm. The image is code.digitaledienst.overheid.nl/$REPO_OWNER/$REPO_NAME and has an
SBOM. It runs nginx as uid 101 on port 8080. The push uses the organisation secrets
REGISTRY_USER and REGISTRY_TOKEN.
Files
| File | Purpose |
|---|---|
Dockerfile |
Build with pnpm, serve with nginx-unprivileged |
nginx-default.conf |
Serves /page from page.html, and gives a real 404 |
renovate.json |
The shared Renovate presets, and the tags of the actions of forgejo/ci-components |
.forgejo/template |
The files in which Forgejo fills in the name of a new repository |