mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 07:59:11 +01:00
The product, its assistant, the repo, the host and every unit on the box now share one name. 638 files, ~3,000 mentions: UI copy, config, env keys (FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs, articles, the deploy workflow other repos reuse, and nine file names. - Three article slugs carried the old name and had been shared; permanent redirects keep those links alive (next.config.ts). - test-no-retired-name.sh now also forbids the old product name across the whole repo, so the rename cannot creep back through templates and examples. - ASSISTANT_STACK collapses the product and the assistant into one entry, because they are now the same name. Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki` database and role, loki.orangecat.ch (old host 308s to it; /api, /widget, /embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases. The Resend sending domain stays fleetcrown.orangecat.ch until the new domain is verified in DNS. Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
123 lines
4.9 KiB
YAML
123 lines
4.9 KiB
YAML
name: CI
|
|
|
|
# WHY THIS FILE EXISTS, AND WHY IT IS NOT OPTIONAL
|
|
#
|
|
# loki's ci-gate.sh treats "CI green" and "no CI at all" identically —
|
|
# both exit 0 and let the deploy proceed. That is a sane default for a repo
|
|
# that has not set CI up yet, and it means a site WITHOUT this file deploys
|
|
# every push completely unverified while looking exactly like one that passed.
|
|
#
|
|
# Substrata shipped to production that way. So the scaffold emits this file with
|
|
# every new site: the gate has something real to wait for from the first commit.
|
|
#
|
|
# Runs the same bundle as `pnpm run verify` locally — one definition of verified.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch: {}
|
|
|
|
# A newer push supersedes an older run. ci-gate.sh understands cancelled-and-
|
|
# superseded as a clean skip rather than a failure.
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# pnpm BEFORE setup-node: `cache: pnpm` needs the binary to resolve the
|
|
# store path, and setup-node fails outright if pnpm is not on PATH yet.
|
|
- uses: pnpm/action-setup@v4
|
|
|
|
# Sites scaffolded before the starter shipped .nvmrc have none, and
|
|
|
|
# setup-node fails on a missing version file (kaffeeklappe-sep11 #3,
|
|
|
|
# 2026-09-11). Default to the fleet's Node line; a committed .nvmrc wins.
|
|
|
|
- name: Node version file
|
|
|
|
run: "[ -f .nvmrc ] || echo 22 > .nvmrc"
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
cache: pnpm
|
|
|
|
# pnpm, not npm: the box deploys with `pnpm run build`, and this template
|
|
# previously scaffolded an npm CI over a repo that had no package-lock.json
|
|
# — so `npm ci` could never succeed and a new site's CI was red or absent
|
|
# from its first commit. .nvmrc is pinned to 22 for the same reason: pnpm 11
|
|
# imports node:sqlite, which does not exist before Node 22.13.
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
# Next keeps its compiler output in .next/cache, and this job BUILDS. With
|
|
# nothing restoring it, every run of every scaffolded site recompiles from
|
|
# scratch — and the deploy then compiles a second time.
|
|
#
|
|
# This file is the third copy of the golden CI floor. The other two live in
|
|
# fleet/templates/ci/, and they gained this step on 2026-09-07 when a fleet
|
|
# sweep found 14 of 32 repos building cold. This one is the copy the
|
|
# scaffold ACTUALLY uses, so it was the one that mattered and the one that
|
|
# was missed — every site created between then and now started cold by
|
|
# construction. Held fleet-wide by fleet's cicd-hygiene-audit.sh, but that
|
|
# ratchet can only flag a repo after it exists; a template fixes it before.
|
|
#
|
|
# Keyed on the lockfile so a dependency change invalidates it. The bare
|
|
# restore-key is last on purpose: a stale cache still beats no cache, and
|
|
# Next validates its own entries rather than trusting them.
|
|
- name: Cache Next.js build
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .next/cache
|
|
key: nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
|
|
restore-keys: |
|
|
nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
|
|
nextjs-${{ runner.os }}-
|
|
|
|
- name: Type check
|
|
run: pnpm run type-check
|
|
|
|
- name: Lint
|
|
# The Loki starter declares no linter yet; a missing script must
|
|
# not fail the site's first CI run.
|
|
run: pnpm run --if-present lint
|
|
|
|
# The build is the real test for a content site: a broken import or a bad
|
|
# config surfaces here and nowhere earlier.
|
|
- name: Build
|
|
run: pnpm run build
|
|
|
|
# A sweep merge uses GITHUB_TOKEN, and a push made with that token triggers
|
|
# no workflows; the CI the sweep then re-arms is itself a dispatch, whose
|
|
# workflow_run event GitHub also suppresses. So after an agent's PR is
|
|
# auto-merged here, NOTHING starts Deploy — kaffeeklappe-sep11 sat an hour
|
|
# on 2026-09-11 with the change merged, CI green, and the site serving the
|
|
# previous release. The sweep's reconciler catches it on its next tick,
|
|
# which is correct, self-healing, and up to ten minutes late.
|
|
#
|
|
# A dispatch is not a push, so this job may start Deploy directly the moment
|
|
# CI proves main green. Same shape as bitbaum/loki's own ci.yml.
|
|
#
|
|
# Only for workflow_dispatch: a real push to main chains through
|
|
# workflow_run by itself, and dispatching here too would ship twice.
|
|
ship:
|
|
needs: verify
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Dispatch Deploy now that main is green
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh workflow run deploy.yml --ref main
|