33 lines
829 B
YAML
33 lines
829 B
YAML
name: sync-to-gitea
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Push to Gitea main
|
|
env:
|
|
GITEA_USERNAME: Admin
|
|
GITEA_TOKEN: ${{ secrets.GITEA_SECRET }}
|
|
run: |
|
|
set -euo pipefail
|
|
echo "Syncing ${{ github.event.repository.name }}:main → Gitea main"
|
|
echo "Commit: $(git rev-parse HEAD)"
|
|
|
|
git remote add gitea "https://${GITEA_USERNAME}:${GITEA_TOKEN}@ci.nxtgauge.com/Admin/${{ github.event.repository.name }}.git"
|
|
|
|
git fetch gitea main || true
|
|
git push gitea HEAD:main --force-with-lease=refs/heads/main
|
|
|
|
echo "Sync complete!"
|