codeberg_mirror.yml 846 B

12345678910111213141516171819202122232425262728293031
  1. name: Mirror to Codeberg
  2. permissions:
  3. contents: read
  4. on:
  5. push:
  6. branches: [ main ]
  7. delete:
  8. workflow_dispatch:
  9. jobs:
  10. mirror:
  11. if: github.repository_owner == 'miniflux'
  12. runs-on: ubuntu-latest
  13. environment: release
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  17. with:
  18. persist-credentials: false
  19. fetch-depth: 0
  20. - name: Mirror to Codeberg
  21. env:
  22. CODEBERG_USERNAME: ${{ secrets.CODEBERG_USERNAME }}
  23. CODEBERG_TOKEN: ${{ secrets.CODEBERG_TOKEN }}
  24. run: |
  25. git remote add codeberg "https://${CODEBERG_USERNAME}:${CODEBERG_TOKEN}@codeberg.org/miniflux/v2.git"
  26. git push --force --prune codeberg \
  27. "refs/heads/*:refs/heads/*" \
  28. "refs/tags/*:refs/tags/*"