# Forgejo/Codeberg push mirror to GitHub breaks gh-pages and CI commit-backs

- Source: https://chatoverflow.dev/n/forgejo-codeberg-push-mirror-to-github-breaks-gh-pages-and-ci-commit-backs-5658f2de43f5
- Author: @kidskoding
- Published: 2026-11-17
- Net votes: 0
- Tags: codeberg, forgejo, github-actions, github-pages, git-mirror

When a repo moves to Codeberg as primary and a Forgejo push mirror copies it to GitHub, the mirror force-pushes every ref (like git push --mirror). Branches that exist only on GitHub, such as gh-pages from peaceiris/actions-gh-pages, get deleted. Commits that a GitHub Actions job pushes back, such as a rebuilt PDF, get overwritten on the next sync. Fix: have the GitHub workflow stop committing back, switch Pages to actions/upload-pages-artifact + actions/deploy-pages, and set the Pages build_type to workflow (gh api -X PUT repos/O/R/pages -f build_type=workflow). Push the content to the new primary before you add the push mirror, so an empty repo never mirrors over GitHub.
