Files
songtrace/mirror/README.md
T
branderson 4a4da08fa0
tests / test (pull_request_target) Successful in 6m38s
Mirror main to GitHub and publish the image to GHCR
mirror/github-mirror.sh publishes main and the tags on it to a read-only
GitHub mirror, as one extra commit that adds a notice under the README
title, so every forge commit is unchanged there and each sync is a
fast-forward. A systemd user service and hourly timer run it from a host
that can push to GitHub; --settings turns off issues, pull requests and
the rest there.

A GitHub Actions workflow builds the image on the mirror and pushes it to
ghcr.io, freeing runner disk first since the CUDA build of torch is
several GB. docker-compose.yml names the image after IMAGE_PREFIX and
IMAGE_TAG, so setting them pulls the published image instead of
building, and the README says how.
2026-10-15 17:55:25 -07:00

1.3 KiB

GitHub mirror

songtrace is developed on a private forge. github-mirror.sh publishes its main and the tags on main to github.com/branderson/songtrace, hourly, from a host that can push to GitHub. Issues and pull requests are off there. Actions stays on, since .github/workflows/images.yml builds the image that ghcr.io/branderson/songtrace serves.

The mirror's main is the forge's plus one commit, which adds a read-only notice under the README's title. Every forge commit is in the mirror unchanged, and each sync fast-forwards. If the README loses its # title, the sync stops instead of publishing without the notice.

Setup

  1. Set up the timer as described at the top of songtrace-github-mirror.service. Give it a deploy key with write access to the GitHub repository.
  2. Run github-mirror.sh --dry-run to build what a sync would publish without pushing it.
  3. Once the first sync has pushed, run github-mirror.sh --settings (needs gh). It turns off issues, pull requests, projects, wiki and discussions.
  4. The first image build creates the package as private. In its settings on GitHub, set its visibility to public.

The timer runs a copy of the script, not the checkout's. Reinstall it after reviewing a change to mirror/.