nxtgauge-ai-assistant/.github/workflows/sync-to-gitea.yml
2026-04-30 20:45:49 +02:00

37 lines
956 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: Sync to Gitea
env:
GITEA_TOKEN: ${{ secrets.GITEA_SECRET }}
REPO: ${{ github.event.repository.name }}
BRANCH: ${{ github.ref_name }}
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
GITEA_URL="https://Admin:${GITEA_TOKEN}@ci.nxtgauge.com/Admin/${REPO}.git"
git remote remove gitea 2>/dev/null || true
git remote add gitea "${GITEA_URL}"
git ls-remote "${GITEA_URL}" >/dev/null
git push "${GITEA_URL}" "HEAD:${BRANCH}" --force
git push "${GITEA_URL}" --tags --force