Backup Sourceforge #84
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: Backup Sourceforge | |
| on: | |
| schedule: | |
| - cron: "9/15 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_COLOR: "1" | |
| UV_SYSTEM_PYTHON: "1" # make uv do global installs | |
| jobs: | |
| backup: | |
| if: github.repository_owner == 'docutils' | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - name: Configure git | |
| run: | | |
| git config user.name "Adam Turner" | |
| git config user.email "9087854+aa-turner@users.noreply.github.com" | |
| # https://sourceforge.net/p/forge/documentation/rsync%20Backups/ | |
| - name: Fetch Docutils from Sourceforge upstream | |
| run: > | |
| rsync | |
| --archive --human-readable --partial --progress --verbose --itemize-changes | |
| "svn.code.sf.net::p/docutils/code/*" | |
| docutils-svnroot | |
| - name: Fetch CVS archives from Sourceforge upstream | |
| if: github.event_name == 'workflow_dispatch' | |
| run: ./archive-cvs.sh | |
| - name: Fetch Docutils release tarballs from Sourceforge upstream | |
| if: github.event_name == 'workflow_dispatch' | |
| run: ./archive-docutils-files.sh | |
| - name: Push to GitHub | |
| run: | | |
| git add --all | |
| git commit -m "SF backup: $(date --utc +'%Y-%m-%d %H:%M:%S GMT')" || echo "No changes to commit" | |
| git push origin master --force-with-lease || echo "Nothing to push" |