map-backup.yml #1438
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: map-backup.yml | |
| on: | |
| schedule: | |
| - cron: '0 */8 * * *' | |
| jobs: | |
| backup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Import Secrets | |
| uses: hollow-cube/actions/secrets@main | |
| with: | |
| token: ${{ secrets.VAULT_TOKEN }} | |
| path: global/map-backup | |
| - name: Install rclone | |
| run: | | |
| curl https://rclone.org/install.sh | sudo bash | |
| - name: Configure rclone | |
| run: | | |
| mkdir -p ~/.config/rclone | |
| cat > ~/.config/rclone/rclone.conf <<EOF | |
| [r2] | |
| type = s3 | |
| provider = Cloudflare | |
| access_key_id = ${R2_ACCESS_KEY} | |
| secret_access_key = ${R2_SECRET_KEY} | |
| endpoint = https://bdb9cb2904188b760591dc1589a1ccf3.r2.cloudflarestorage.com | |
| [aws] | |
| type = s3 | |
| provider = AWS | |
| access_key_id = ${AWS_ACCESS_KEY} | |
| secret_access_key = ${AWS_SECRET_KEY} | |
| region = us-east-1 | |
| EOF | |
| - name: Sync R2 -> S3 | |
| run: | | |
| rclone sync r2:mapmaker aws:hollow-cube-maps-backup \ | |
| --progress \ | |
| --transfers 4 \ | |
| --checkers 8 \ | |
| --delete-during \ | |
| --fast-list |