32 lines
977 B
YAML
32 lines
977 B
YAML
name: Mirror to Codeberg and Gitea
|
|
|
|
on:
|
|
push:
|
|
branches: ["*"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
mirror:
|
|
runs-on: ubuntu:22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # all history fr
|
|
|
|
- name: Mirror to Codeberg and Gitea
|
|
env:
|
|
CODEBERG_USERNAME: ${{ secrets.CODEBERG_USERNAME }}
|
|
CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
|
|
GITEA_USERNAME: ${{ secrets.GITEA_USERNAME }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
git config --global user.name "GitHub Mirror Bot"
|
|
git config --global user.email "[email protected]"
|
|
|
|
git remote add codeberg https://$CODEBERG_USERNAME:[email protected]/$CODEBERG_USERNAME/Poopsar.git
|
|
git remote add gitea https://$GITEA_USERNAME:[email protected]/$GITEA_USERNAME/Poopsar.git
|
|
|
|
git push --mirror codeberg
|
|
git push --mirror gitea
|