diff --git a/.gitea/workflows/mirror.yml b/.gitea/workflows/mirror.yml new file mode 100644 index 0000000..23087f4 --- /dev/null +++ b/.gitea/workflows/mirror.yml @@ -0,0 +1,26 @@ + +name: Mirror to GitHub + +on: + push: + branches: + - main + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Push repository to GitHub + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + set -eu + git clone --bare \ + https://oauth2:${GH_TOKEN}@github.com/tafakkur/PyNix-Website.git \ + mirror.git + cd mirror.git + git fetch --prune \ + https://oauth2:${GH_TOKEN}@github.com/tafakkur/PyNix-Website.git \ + '+refs/heads/*:refs/heads/*' + git push --mirror \ + https://oauth2:${GH_TOKEN}@github.com/tafakkur/PyNix-Website.git