CI: add Forgejo package build + GitHub mirror workflows
All checks were successful
Mirror to GitHub / mirror (push) Successful in 1s
Build and publish package / package (push) Successful in 2m41s

This commit is contained in:
Breadway 2026-07-03 13:44:53 +08:00
parent 9f97f2c989
commit c13747e867
2 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,21 @@
name: Mirror to GitHub
on:
push:
branches: ['**']
tags: ['**']
jobs:
mirror:
runs-on: [self-hosted, hestia]
steps:
- name: Mirror to GitHub
run: |
set -euo pipefail
git clone --mirror "https://git.breadway.dev/${GITHUB_REPOSITORY}.git" repo.git
cd repo.git
# Mirror only branches and tags (not refs/pull/*, which GitHub rejects);
# --prune deletes GitHub refs that no longer exist on Forgejo.
git push --prune \
"https://x-access-token:${{ secrets.MIRROR_TOKEN }}@github.com/Breadway/breadlock.git" \
'+refs/heads/*:refs/heads/*' '+refs/tags/*:refs/tags/*'