Mirror main to GitHub #37

Merged
branderson merged 2 commits from github-mirror into main 2026-10-16 00:15:40 -07:00
Collaborator

Summary generated by LLM agent

Mirrors songtrace to github.com/branderson/songtrace, following the mirror half of dotcom-arcade#14. Its GHCR image build is left out for now.

Mirror

mirror/github-mirror.sh is dotcom-arcade's script with songtrace's names. The logic is unchanged:

  • What it publishes: the forge's main plus one extra commit, which adds a read-only notice under the README's # songtrace title. The commit's parents are the forge commit and the previous mirror commit, so every forge SHA is on GitHub unchanged and each sync is a fast-forward.
  • Tags: only tags on main are published, so one on another branch can't publish unreleased work.
  • No title, no sync: if the README loses its title, the sync stops rather than publishing without the notice.
  • Modes: --dry-run builds without pushing, and --settings turns off issues, PRs, projects, wiki and discussions on GitHub.

mirror/songtrace-github-mirror.service and .timer run it hourly as a systemd user unit. It reads ~/.config/songtrace/github-mirror.env and installs a copy of the script rather than a link, as in dotcom-arcade. mirror/README.md has the setup steps.

Install

No prebuilt image for now: users build it themselves. The README's quick start uses docker compose up -d --build, which also rebuilds after a git pull, and says so. Development points at the mirror.

Testing

The sandbox's git guard refuses every push, even to a local path, so I tested the sync against a local fake forge and fake GitHub. I used --dry-run, and had the fake GitHub fetch each built commit to stand in for the push:

  • First sync: the mirror commit's first parent is the forge's main, the notice sits under the title, and only README.md differs from the forge.
  • Second sync: "already at", no change.
  • After a new forge commit: a fast-forward over the previous mirror commit. v0.1.0 on main is selected and v9.9.9 on a side branch isn't.
  • Determinism: re-running gives the identical commit.
  • README without a title: --transform stops with "no title to put the mirror notice under".

Not tested: the real GitHub push and the systemd units, which need your host and GitHub.

**Summary generated by LLM agent** Mirrors songtrace to [github.com/branderson/songtrace](https://github.com/branderson/songtrace), following the mirror half of dotcom-arcade#14. Its GHCR image build is left out for now. ## Mirror `mirror/github-mirror.sh` is dotcom-arcade's script with songtrace's names. The logic is unchanged: - **What it publishes:** the forge's `main` plus one extra commit, which adds a read-only notice under the README's `# songtrace` title. The commit's parents are the forge commit and the previous mirror commit, so every forge SHA is on GitHub unchanged and each sync is a fast-forward. - **Tags:** only tags on `main` are published, so one on another branch can't publish unreleased work. - **No title, no sync:** if the README loses its title, the sync stops rather than publishing without the notice. - **Modes:** `--dry-run` builds without pushing, and `--settings` turns off issues, PRs, projects, wiki and discussions on GitHub. `mirror/songtrace-github-mirror.service` and `.timer` run it hourly as a systemd user unit. It reads `~/.config/songtrace/github-mirror.env` and installs a copy of the script rather than a link, as in dotcom-arcade. `mirror/README.md` has the setup steps. ## Install No prebuilt image for now: users build it themselves. The README's quick start uses `docker compose up -d --build`, which also rebuilds after a `git pull`, and says so. Development points at the mirror. ## Testing The sandbox's git guard refuses every push, even to a local path, so I tested the sync against a local fake forge and fake GitHub. I used `--dry-run`, and had the fake GitHub fetch each built commit to stand in for the push: - **First sync:** the mirror commit's first parent is the forge's `main`, the notice sits under the title, and only `README.md` differs from the forge. - **Second sync:** "already at", no change. - **After a new forge commit:** a fast-forward over the previous mirror commit. `v0.1.0` on `main` is selected and `v9.9.9` on a side branch isn't. - **Determinism:** re-running gives the identical commit. - **README without a title:** `--transform` stops with "no title to put the mirror notice under". Not tested: the real GitHub push and the systemd units, which need your host and GitHub.
dejima-agent added 1 commit 2026-10-15 17:54:54 -07:00
Mirror main to GitHub and publish the image to GHCR
tests / test (pull_request_target) Successful in 6m38s
4a4da08fa0
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.
dejima-agent changed title from Mirror main to GitHub and publish the image to GHCR to Mirror main to GitHub 2026-10-16 00:10:02 -07:00
dejima-agent added 1 commit 2026-10-16 00:10:03 -07:00
Drop the GHCR image build; users build with docker compose
tests / test (pull_request_target) Successful in 4m18s
0fc4ad0e08
Publishing a prebuilt image can wait. Remove the GitHub Actions image
workflow and the IMAGE_PREFIX/IMAGE_TAG image name in docker-compose.yml,
and have the README's quick start build with docker compose up -d
--build, which also rebuilds after a git pull. The mirror's docs and
script no longer mention Actions or the package.
branderson approved these changes 2026-10-16 00:10:36 -07:00
branderson merged commit 902a0403f6 into main 2026-10-16 00:15:40 -07:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: branderson/songtrace#37