Repository navigation
[CI] Publish Assets #4550
Workflow file for this run
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: | |
| workflow_call: | |
| schedule: | |
| - cron: '0 */3 * * *' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: upload | |
| cancel-in-progress: false | |
| env: | |
| AWS_REGION: us-east-1 | |
| jobs: | |
| upload: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| ref: ${{ github.ref_name || 'master' }} | |
| fetch-depth: 2 | |
| - name: Configure AWS credentials | |
| 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 to R2 | |
| run: | | |
| aws s3 sync blockchains/ s3://${{ secrets.R2_ASSETS_BUCKET }}/blockchains/ \ | |
| --endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \ | |
| --size-only \ | |
| --delete | |
| - name: Sync lists to R2 | |
| run: | | |
| aws s3 sync lists/ s3://${{ secrets.R2_ASSETS_BUCKET }}/lists/ \ | |
| --endpoint-url https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com \ | |
| --size-only \ | |
| --delete | |
| - name: Purge cache | |
| run: | | |
| git show --name-only --pretty="" HEAD -- blockchains/ lists/ > /tmp/changed.txt || true | |
| ./.github/scripts/purge-cache.sh "${{ secrets.R2_PURGE_CACHE_ZONE_ID }}" "${{ secrets.R2_PURGE_CACHE_SECRET_KEY }}" "${{ secrets.R2_PURGE_CACHE_URL }}" /tmp/changed.txt |