name: Mirror to Codeberg

on:
  push:
    branches:
      - main

jobs:
  mirror:
    runs-on: eulernest

    steps:
      - name: Mirror all branches to Codeberg
        env:
          CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
          GITEA_MIRROR_TOKEN:  ${{ secrets.MIRROR_TOKEN }}
        run: |
          git clone --bare \
            https://oauth2:${GITEA_MIRROR_TOKEN}@git.eulernest.eu/conformallab/ConformalLabpp.git \
            repo.git
          cd repo.git
          git push --mirror \
            https://TMoussa:${CODEBERG_TOKEN}@codeberg.org/TMoussa/ConformalLabpp.git