ci: sync GitHub pushes to Forgejo
Some checks failed
build-and-push / build (push) Failing after 0s

This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-03 18:58:30 +05:30
parent ee45ea44db
commit c30ff8dc9c

38
.github/workflows/sync-to-forgejo.yml vendored Normal file
View file

@ -0,0 +1,38 @@
name: sync-to-forgejo
on:
push:
branches:
- main
- high-performance
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sync-to-forgejo-${{ github.ref }}
cancel-in-progress: true
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Push to Forgejo
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: |
set -euo pipefail
git remote add forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git" 2>/dev/null || \
git remote set-url forgejo "https://admin:${FORGEJO_TOKEN}@ci.nxtgauge.com/ashwin/${{ github.event.repository.name }}.git"
git push forgejo "HEAD:${GITHUB_REF#refs/heads/}" --force