mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:37:19 +01:00
scripts/site-template is now bitbaum/fleet templates/app — Next.js 16, better-auth accounts (password, link, passkey, 2FA, OrangeCat/bitbaum sign-in as env-gated OIDC), en/de/fr, nonce CSP, ai-kit/mail-kit/limitkit/bip-kit, tests and CI — copied at a pinned fleet commit by scripts/templates/sync-starter.sh. CI proves the copy is exact (sync-starter.sh --check), and starter-sync.yml opens the PR when fleet's starter moves. Never edited here. The kickoff's "nextjs-tailwind" starter seeds the same app from src/lib/starter-app.generated.ts (generated from the directory, pinned by scripts/test/starter-app.ts), minus the workflows register-site.sh adds with the site's CD. The repo is seeded in one Trees API call with inline contents instead of a blob POST per file (~85 for this starter). The widget token rides in .env.production; the starter's .gitleaks.toml allows NEXT_PUBLIC_* values. The new-from-scratch picker reads the light template list, so the starter's file bodies never reach a client bundle. Both paths give the site its database and auth/seal secrets ON THE BOX (scripts/hetzner/provision-db-on-box.sh: role + database, ~/.db-credentials, /opt/<slug>/shared/.env; existing secrets never replaced; nothing printed), and record the db in the register row so every deploy applies drizzle/. register-site.sh seeds the starter's full workflow set to starter repos and the golden CI floor to anything else, never overwriting another repo's ci.yml. test-site-template.sh follows the starter (verify SSOT, design tokens instead of a local palette) and its comment stripper is fixed: the sed range deleted the page from the doc comment to EOF, so every day-zero check had been passing against an empty string. check-template-contrast.mjs and the starter-lock generator are retired with the files they checked. Claude-Session: https://claude.ai/code/session_01W7K2Gm5wcbfCi7THtmV1Hy Co-authored-by: Claude <noreply@anthropic.com>
57 lines
2.3 KiB
YAML
57 lines
2.3 KiB
YAML
name: Starter sync
|
|
|
|
# scripts/site-template is bitbaum/fleet templates/app — the one starter every
|
|
# new product is created from — pinned to a fleet commit. When fleet's starter
|
|
# moves, this opens the pull request that moves the copy (and the kickoff's
|
|
# generated file map) with it; CI and the auto-merge sweep take it from there.
|
|
# Daily, and on demand after a fleet change that should reach new sites now.
|
|
on:
|
|
schedule:
|
|
- cron: "37 4 * * *"
|
|
workflow_dispatch: {}
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
concurrency:
|
|
group: starter-sync
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: 24
|
|
- name: Copy fleet's starter at its current main
|
|
run: bash scripts/templates/sync-starter.sh
|
|
- name: Open the pull request, if anything moved
|
|
env:
|
|
# A PR opened with GITHUB_TOKEN starts no CI; the org PAT does.
|
|
GH_TOKEN: ${{ secrets.FLEET_PAT || secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
if git diff --quiet && [ -z "$(git ls-files --others --exclude-standard scripts/site-template)" ]; then
|
|
echo "scripts/site-template already matches fleet main"
|
|
exit 0
|
|
fi
|
|
sha="$(cat scripts/site-template/.fleet-source)"
|
|
branch="starter-sync/${sha:0:12}"
|
|
if git ls-remote --exit-code origin "refs/heads/$branch" >/dev/null 2>&1; then
|
|
echo "$branch already open"
|
|
exit 0
|
|
fi
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git checkout -b "$branch"
|
|
git add -A scripts/site-template src/lib/starter-app.generated.ts
|
|
git commit -m "chore(starter): sync scripts/site-template to bitbaum/fleet@${sha:0:12}"
|
|
git push -u origin "$branch"
|
|
gh pr create --base main --head "$branch" \
|
|
--title "chore(starter): sync to bitbaum/fleet@${sha:0:12}" \
|
|
--body "Copies bitbaum/fleet templates/app at ${sha} into scripts/site-template and regenerates the kickoff's file map. Opened by starter-sync.yml."
|