Back up code to other forges #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Back up code to other forges | |
| on: | |
| schedule: | |
| - cron: '0 2 * * *' # Run every day at 2 AM | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| push-to-forges: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'goatcorp/Dalamud' | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: webfactory/ssh-agent@a6f90b1f127823b31d4d4a8d96047790581349bd #v0.9.1 | |
| with: | |
| ssh-private-key: | | |
| ${{ secrets.MIRROR_GITLAB_SYNC_KEY }} | |
| ${{ secrets.MIRROR_CODEBERG_SYNC_KEY }} | |
| - name: Add remotes & push | |
| env: | |
| GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=accept-new" | |
| run: | | |
| git remote add gitlab [email protected]:goatcorp/Dalamud.git | |
| git push gitlab --all --force | |
| git remote add codeberg [email protected]:goatcorp/Dalamud.git | |
| git push codeberg --all --force |