Upload Assets to R2 #2999
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: Upload Assets to R2 | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 */3 * * *' # Runs every 3 hours | |
| env: | |
| AWS_REGION: us-east-1 | |
| jobs: | |
| upload: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout release repo | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS credentials for R2 | |
| run: | | |
| aws configure set aws_access_key_id ${{ secrets.R2_ACCESS_KEY_ID }} | |
| aws configure set aws_secret_access_key ${{ secrets.R2_ACCESS_SECRET_KEY }} | |
| aws configure set region ${{ env.AWS_REGION }} | |
| - name: Sync blockchains folder to R2 (only new/changed files) | |
| run: | | |
| aws s3 sync blockchains/ s3://${{ secrets.R2_ASSETS_BUCKET }}/blockchains/ \ | |
| --endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \ | |
| --size-only \ | |
| --delete |