diff --git a/.github/workflows/mirror-to-gitea.yml b/.github/workflows/mirror-to-gitea.yml new file mode 100644 index 0000000..7b7b11d --- /dev/null +++ b/.github/workflows/mirror-to-gitea.yml @@ -0,0 +1,28 @@ +name: Mirror to Gitea + +on: + push: + branches: + - main + - master + workflow_dispatch: + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Mirror to Gitea + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITEA_USERNAME: ${{ secrets.GITEA_USERNAME }} + run: | + REPO_NAME=$(basename $GITHUB_REPOSITORY) + git remote add gitea https://$GITEA_USERNAME:$GITEA_TOKEN@gitea.jeffemmett.com/jeffemmett/$REPO_NAME.git || true + git push gitea --all --force + git push gitea --tags --force +