tests / test (pull_request_target) Successful in 6m38s
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.
1.3 KiB
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
- 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. - Run
github-mirror.sh --dry-runto build what a sync would publish without pushing it. - Once the first sync has pushed, run
github-mirror.sh --settings(needsgh). It turns off issues, pull requests, projects, wiki and discussions. - 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/.