ci(deploy): Gitea-driven build/push/deploy for netcup #14
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/gitea-ci-deploy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces the GitHub Pages workflow with a Gitea Actions pipeline that publishes the cc image to
git.librete.ch/libretech/code-crispiesand ssh-deploys it to/srv/ccon netcup.Changes
.gitea/workflows/ci.yml— npm test + sanity build (with placeholder VITE_*) on every push / PR..gitea/workflows/deploy.yml— single-job build → push → ssh-deploy → /healthz check, gated onvars.DEPLOY_ENABLED. Tag push →:vX.Y.Z+:latest; main push →:main+:sha-<7>.compose.yaml— addsimage: ${CC_IMAGE:-cc:local}so production pulls the published tag while dev still builds locally.git.librete.ch/libretech/runner-image:v1(no third-party Docker Hub images, no--user root).Operator follow-up (before merging into hot deploy)
https://git.librete.ch/libretech/code-crispies/settings/actions/secrets:REGISTRY=git.librete.chREGISTRY_USER=libretech(user-namespace packages — bot can't push)REGISTRY_PASS=<libretech package PAT>(same PAT used forlibretech/runner-image)DEPLOY_HOST=root@cloud.librete.chDEPLOY_KEY=<bot deploy private key>(same key as librenotes deploy)DEPLOY_PATH=/srv/ccHEALTH_URL=https://cc.cloud.librete.ch/VITE_SUPABASE_URL=https://yretixuyfuiresnrjkbs.supabase.coVITE_SUPABASE_ANON_KEY=<the anon key>(public-by-design supabase key)DEPLOY_ENABLED=trueonce the secrets are in.CC_IMAGE=git.librete.ch/libretech/code-crispies:mainto/srv/cc/.envon netcup (no rebuild on host).Verification
yq -e .parses both workflow YAMLs.docker compose configresolves cleanly in both build mode (noCC_IMAGE) and image-pull mode (CC_IMAGE=test:1).npm testis the same script the previous github-pages workflow ran.Adds .gitea/workflows/{ci,deploy}.yml. Both jobs run inside the custom git.librete.ch/libretech/runner-image:v1 image. CI on every push runs npm test + a sanity build with placeholder VITE_*. The deploy workflow (gated on vars.DEPLOY_ENABLED) builds the multi-stage Vite + nginx Dockerfile, pushes to git.librete.ch/libretech/code-crispies (main → :main + :sha-<short>; tag → :<tag> + :latest), and ssh-deploys the netcup stack with 'docker compose pull && up -d'. compose.yaml gains an opt-in image-pull mode: CC_IMAGE pins the published tag in production (set in /srv/cc/.env), while the dev shell falls through to a local build when CC_IMAGE is unset. Replaces the legacy github-pages workflow at .github/workflows/main.yml which targeted GitHub Pages, not the netcup deployment.