ci: build on GitHub via the mirror, switchable with BUILD_ON #126

Merged
jcoffey-dev merged 1 commits from ci/build-on-github into main 2026-09-30 06:52:16 +00:00
Owner

Gitea stays the source of truth and push-mirrors every commit and tag to the GitHub replica. This lets GitHub Actions do the heavy building (native amd64 and arm64 runners) while Gitea keeps releases, announcements and gating.

The switch is the organization variable BUILD_ON, set on both forges:

  • BUILD_ON=github: .github/workflows/ci.yml runs on GitHub, publishes to the Gitea registry/releases as before, and posts a github/ci (branch|tag) commit status back. Gitea's build jobs skip; a new github job waits for that status, so this repository's Gitea checks still pass or fail with the real result.
  • BUILD_ON unset: nothing changes. GitHub's jobs skip and Gitea builds exactly as today. This is also the fallback if GitHub is unavailable.

Merging this is inert until the variable is set.

GitHub-era workflows that would misbehave once mirrored (scheduled releases, GHCR publishing and pruning) are removed, as is any dependabot.yml: every mirror sync deletes branches that exist only on GitHub, so its pull requests could never land.

GitHub organization settings this needs: variables BUILD_ON, REGISTRY, GITEA_URL; secret GITEA_TOKEN (write:repository + write:package); the three pinned docker/* actions allowed.

Gitea stays the source of truth and push-mirrors every commit and tag to the GitHub replica. This lets GitHub Actions do the heavy building (native amd64 and arm64 runners) while Gitea keeps releases, announcements and gating. **The switch** is the organization variable `BUILD_ON`, set on both forges: - `BUILD_ON=github`: `.github/workflows/ci.yml` runs on GitHub, publishes to the Gitea registry/releases as before, and posts a `github/ci (branch|tag)` commit status back. Gitea's build jobs skip; a new `github` job waits for that status, so this repository's Gitea checks still pass or fail with the real result. - `BUILD_ON` unset: nothing changes. GitHub's jobs skip and Gitea builds exactly as today. This is also the fallback if GitHub is unavailable. Merging this is inert until the variable is set. GitHub-era workflows that would misbehave once mirrored (scheduled releases, GHCR publishing and pruning) are removed, as is any `dependabot.yml`: every mirror sync deletes branches that exist only on GitHub, so its pull requests could never land. GitHub organization settings this needs: variables `BUILD_ON`, `REGISTRY`, `GITEA_URL`; secret `GITEA_TOKEN` (write:repository + write:package); the three pinned `docker/*` actions allowed.
jcoffey-dev added 1 commit 2026-09-30 06:18:13 +00:00
Build on the GitHub mirror when BUILD_ON=github
ci / build (pull_request) Successful in 7m46s
ci / github (pull_request) Skipped
ci / fork-checks (pull_request) Successful in 2m4s
3450c31345
Gitea stays where the project lives and push-mirrors every branch and tag
to GitHub. With the Actions variable BUILD_ON set to 'github' on both
forges, the GitHub copy does the building and reports back to Gitea as a
commit status; unset, nothing changes and Gitea builds as before.

.github/workflows/ci.yml replaces the GitHub-era files. Branch pushes run
what Gitea's ci.yml checks (fork checks, dev build, test targets, the
release profile on main). v* tags run what publish.yml does, with the same
two guards: the image per architecture on native runners side by side,
the multi-arch index and :latest, the Gitea Release if the tag has none,
and the host-install binaries taken out of the image. A final job posts
"github/ci (branch)" or "github/ci (tag)" to the commit on Gitea.

On Gitea, the heavy jobs skip under BUILD_ON=github and a `github` job
waits for that status and passes or fails with it, so pull requests and
merges still look at a Gitea run. The weekly release, the upstream watch
and the announcement stay on Gitea.

Removed: cleanup.yml and publish.yml (GHCR), release.yml (a second weekly
schedule), and dependabot.yml, whose pull request branches every mirror
sync would delete.
jcoffey-dev merged commit dd57709522 into main 2026-09-30 06:52:16 +00:00
jcoffey-dev deleted branch ci/build-on-github 2026-09-30 06:52:19 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: inbuxa/inbuxa-server#126