Files
songtrace/mirror/songtrace-github-mirror.service
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

27 lines
1.2 KiB
Desktop File

# User unit for the GitHub mirror, on a host that can push to GitHub. Never in
# a dejima session: a sandbox may push only to its own forge.
#
# install -m 755 mirror/github-mirror.sh ~/.local/bin/songtrace-github-mirror
# cp mirror/songtrace-github-mirror.service mirror/songtrace-github-mirror.timer ~/.config/systemd/user/
# systemctl --user daemon-reload
# systemctl --user enable --now songtrace-github-mirror.timer
#
# A copy, not a link into the checkout: the timer holds a key that can push to
# GitHub, and a session working in this checkout can edit the script.
# Reinstall it after reviewing an update.
#
# ~/.config/songtrace/github-mirror.env sets MIRROR_SOURCE, the forge
# clone URL, and whatever else mirror/github-mirror.sh documents. The GitHub
# key, a deploy key with write access to the repository, belongs behind an ssh
# Host alias named in MIRROR_TARGET, so it is not also offered to the forge:
#
# MIRROR_SOURCE=git@forge.example.com:owner/songtrace.git
# MIRROR_TARGET=git@github-songtrace:branderson/songtrace.git
[Unit]
Description=Mirror songtrace's main and release tags to GitHub
[Service]
Type=oneshot
EnvironmentFile=%h/.config/songtrace/github-mirror.env
ExecStart=%h/.local/bin/songtrace-github-mirror