feat(deploy): publish image to Gitea Packages + switch netcup to image pull #42
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/registry-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?
Closes #39.
Summary
compose.netcup.yamlno longer builds locally; pulls${LIBRENOTES_IMAGE}(defaultgit.librete.ch/public/librenotes:main)..gitea/workflows/deploy.ymlbuilds + pushes to${REGISTRY}/public/librenotes(main →:main+:<sha7>; tag →:vX.Y.Z+:latest), then SSHes to the deploy host and reruns compose. Tag pushes pinLIBRENOTES_IMAGEin the host.envviaperl -i.ci.yml) run insidecatthehacker/ubuntu:runner-latestbecause the defaultnode:20-bookwormrunner image lacksmakeand a docker CLI. The build job bind-mounts/var/run/docker.sock; the runner repo'sconfig.yamlwhitelists that path undervalid_volumes.docker-compose.{yml,prod.yml}→compose.{yaml,prod.yaml}(Compose v2 spec).docs/operations.md+docs/self-hosting.mdupdated with the new secret matrix, compose invocations, rollback example, and Gitea runner notes.Out-of-band tasks (left for the operator)
package:writeon thepublicorg.https://git.librete.ch/public/librenotes/settings/actions/secrets:REGISTRY=git.librete.ch,REGISTRY_USER,REGISTRY_PASS,DEPLOY_HOST=root@netcup,DEPLOY_KEY(passphrase-less private key),DEPLOY_PATH=/srv/librenotes,HEALTH_URL=https://ln.cloud.librete.ch/healthz.DEPLOY_ENABLED=true.valid_volumesentry is loaded./srv/librenotes/.env, addLIBRENOTES_IMAGE=git.librete.ch/public/librenotes:v0.1.0.Verification
yq -e .parses all touched YAML.docker compose -f compose.yaml -f compose.netcup.yaml configresolves.mainpush will only run anything onceDEPLOY_ENABLED=true; the workflow is safe to merge before secrets are set.compose.netcup.yaml now references ${LIBRENOTES_IMAGE} with pull_policy: always and resets the base build context. .env.netcup.example documents the new LIBRENOTES_IMAGE key (default git.librete.ch/public/librenotes:main, pin to immutable tag for prod). Rollback: edit .env LIBRENOTES_IMAGE + up -d.- Image base is now ${REGISTRY}/public/librenotes (matches Gitea owner/repo). - Remote step writes LIBRENOTES_IMAGE on tag pushes via perl, then pulls and restarts using the new compose.yaml + compose.netcup.yaml stack files. - Both jobs run inside catthehacker/ubuntu:runner-latest; the default node:20-bookworm runner image lacks make + docker. The build job bind-mounts /var/run/docker.sock for build-push-action; the runner config must whitelist that path under valid_volumes.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.