jnss-web

Static website for jnss.me - built with SvelteKit and deployed via Caddy.

Project Structure

This project uses a two-branch deployment strategy:

  • main branch: Source code and development
    • Contains all source files, configuration, and build tooling
    • build/ directory is gitignored
  • deploy branch: Orphan branch with build outputs only
    • Contains only the static build artifacts (index.html, _app/, etc.)
    • No source code or build dependencies
    • Used by Ansible/Caddy for serving the site

Development

Install dependencies:

bun install

Start development server:

bun run dev

# or open in browser automatically
bun run dev -- --open

Building

Build the static site:

bun run build

Preview the production build locally:

bun run preview

Deployment

This project uses an automated deployment script that builds and pushes to the deploy branch:

# Deploy with auto-generated timestamp commit message
./deploy.sh

# Deploy with custom commit message
./deploy.sh "Add new feature X"

What the script does:

  1. Builds the site on the main branch (bun run build)
  2. Switches to the deploy branch
  3. Clears old build files
  4. Moves new build output to the root of deploy branch
  5. Commits and pushes to origin/deploy
  6. Switches back to main branch

For rick-infra: The Ansible role clones the deploy branch to get production-ready static files:

git clone -b deploy git@jnss.me:joakim/jnss-web.git

Tech Stack

  • Framework: SvelteKit 2.x with static adapter
  • Build Tool: Vite 7.x
  • Package Manager: Bun
  • Deployment: Two-branch strategy (main → source, deploy → build artifacts)
  • Hosting: Caddy (configured via rick-infra)
Description
No description provided
Readme 224 KiB
Languages
Svelte 38.2%
CSS 25.2%
Shell 23.4%
JavaScript 9.1%
HTML 4.1%