SB Sommar – Project Documentation

SB Sommar – Requirements: Build and Deploy

CI pipelines, lint gates, environments (local/QA/production), zero-downtime deploy, release docs, footer version, the docs site build.

Part of the requirements index. Section IDs (02-§N.M) are stable and cited from code; they do not encode the file path.


23. Event Data CI Pipeline — superseded by §50

§23.1–§23.13 are superseded — see Archived (superseded). §23.14 still applies to ci.yml.

23.0 Git history for branch comparison



32. HTML Validation in CI

The build generates HTML pages. Invalid HTML must be caught automatically before merge. This closes the CL-§5.1 gap.

32.1 Tool

32.2 Scope

32.3 CI integration

32.4 Configuration



33. CSS Linting in CI

CSS source files must be linted automatically before merge. This closes the CL-§5.2 gap.

33.1 Tool

33.2 Scope

33.3 CI integration

33.4 Configuration



40. Zero-Downtime Static Site Deploy

The static site deploy must use a staging-and-swap strategy that limits downtime to milliseconds. The build output is uploaded to a staging directory via SCP, then swapped into the live web root with server-side mv operations.

40.1 Deploy method (site requirements)

40.2 Build packaging (site requirements)

40.3 Secrets and configuration (site requirements)

40.4 Unchanged behaviour (site requirements)

40.5 Error handling (site requirements)



41. Environment Management

The project uses three environments — Local, QA, and Production — deployed from a single main branch. Code changes are promoted to Production manually; event data reaches both environments immediately.

41.1 Environments (site requirements)

41.2 GitHub Environments (site requirements)

41.3 Reusable deploy workflow (site requirements)

41.4 Event data deploy (site requirements)

41.5 Hardcoded URL fix (site requirements)

41.6 CI workflow (site requirements)

41.7 Local development (site requirements)



43. Replace FTP with SSH for QA Deploys

FTP transmits credentials in cleartext and requires a separate set of secrets (FTP_HOST, FTP_USERNAME, FTP_PASSWORD). The static site deploy already uses SCP/SSH. This section migrates the remaining FTP-based deploy steps to SSH for the QA environment, reducing the attack surface and the number of secrets to manage. Production remains on FTP until QA is validated.

43.1 Event data deploy — QA (site requirements)

43.2 API server deploy — remove redundant FTP step (site requirements)

43.3 Production — superseded by §50.5

§43.9–§43.10 are superseded — see Archived (superseded).

43.4 Documentation (site requirements)

43.5 QA FTP secret cleanup (operational)



44. PHP API for Shared Hosting

The Node.js API server (app.js) requires a Node.js-capable host with Passenger or a similar process manager. Loopia (the target webhotell) supports PHP and Apache but not Node.js. This section adds a PHP implementation of the same API so that the entire site — static files and API — can be served from a single shared hosting account.

The Node.js API is kept intact for local development and for any future host that supports Node.js.

44.1 PHP API endpoints (site requirements)

44.2 Input validation (site requirements)

44.3 Time-gating (site requirements)

44.4 GitHub integration (site requirements)

44.5 Session cookies (site requirements)

44.6 CORS (site requirements)

44.7 Configuration (site requirements)

44.8 File structure (site requirements)

44.9 Apache routing (site requirements)

44.10 Deployment (site requirements)

44.11 Build integration (site requirements)

44.12 Coexistence with Node.js API (site requirements)

44.13 Documentation (site requirements)



50. Docker-Based Event Data CI Pipeline

Event data validation (injection patterns, link protocol, length limits) runs in the API layer at submission time. Data that reaches git is already validated. The CI pipeline for event-data PRs provides a branch-protection gate, and a post-merge workflow builds and deploys event-data files.

§50.1–§50.7 (Docker image and build workflow) are superseded by §52 — see Archived (superseded).

50.3 Event data PR check (site requirements)

50.4 Post-merge event data deploy (site requirements)

50.5 Production event data deploy method (site requirements)

50.6 CI workflow for data-only changes (site requirements)



51. Event Data Deploy — Eliminate Serial Detect Job

The post-merge event-data deploy workflow (§50.4) currently runs a serial detect job before starting the three parallel deploy jobs. This adds ~15 seconds to the critical path because the deploy jobs must wait for detect to finish before they can start. Each environment requires its own build (different SITE_URL and BUILD_ENV), so sharing build artifacts is not possible. Eliminating the serial dependency is the primary lever for reducing deploy latency.

51.1 Workflow structure (site requirements)

51.2 Inline detection (site requirements)

51.3 Production QA gating (site requirements)

51.4 Superseded requirements



52. Replace Docker Container with setup-node + npm Cache

The post-merge event-data deploy workflow (§50.4) previously used a pre-built Docker image from GHCR to avoid running npm ci on every deploy. While this eliminated npm ci time, pulling the Docker image itself added ~20 seconds per job. Replacing the Docker container with actions/setup-node and the built-in npm cache achieves the same dependency-availability goal with lower overhead: cache restore takes ~2–3 seconds on cache hit, and npm ci --omit=dev installs four small production packages in ~3 seconds.

52.1 Dependency installation method (site requirements)

52.2 Conditional vs unconditional installation (site requirements)

52.3 Superseded requirements



60. Release and Deployment Documentation

Background

The project has a working CI/CD pipeline (QA auto-deploy, production manual trigger) but no contributor-facing documentation explaining the deploy flow, how to release to production, or who is authorized to do so. A new contributor who is not familiar with the GitHub Actions setup cannot determine how their changes reach users.

60.1 Contributor documentation requirements

60.2 Environment protection requirements

60.3 Release guide requirements



62.0 Motivation

QA testers and administrators need to confirm which version of the site is deployed. Without a visible version indicator, there is no way to know whether a deploy has completed or which build is currently live. A version string in the footer solves this with minimal visual impact.

62.1 VERSION file

62.3 Version string per environment

62.4 Automatic production tagging

62.5 Automatic GitHub Release on major/minor bump

62.6 Build integration

62.7 QA redeploy after production deploy



97. Project Documentation Site

97.1 Context

The project documentation in docs/ is structured Markdown covering contribution guidelines, requirements, architecture, data contract, operations, design, environments, releasing, and the traceability matrix. Reading it on GitHub’s file viewer works, but cross-file links render as raw .md file downloads in some contexts and searching requires opening files one at a time.

Publishing the same content as a small, read-only documentation site lets contributors and stakeholders browse the docs in a regular browser, follow internal links without friction, and link directly to specific sections when reporting issues or discussing changes. The documentation site is entirely separate from the main sbsommar.se site — it does not affect the camp website, the PHP API, or any existing deployment workflow.

97.2 Publication (site requirements)

97.3 Rendering (site requirements)

97.4 Landing page

97.5 Constraints

97.6 Repository-root discoverability

97.7 Reverse-discoverability banner

97.8 Search-engine and crawler policy