Repository navigation
[CI] Publish Assets #5140
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: "[CI] Publish Assets" | |
| 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 | |
| R2_ASSETS_BUCKET: ${{ secrets.R2_ASSETS_BUCKET }} | |
| R2_ENDPOINT_URL: https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com | |
| 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 | |
| uses: ./.github/actions/sync-r2 | |
| with: | |
| directory: blockchains | |
| - name: Sync lists to R2 | |
| uses: ./.github/actions/sync-r2 | |
| with: | |
| directory: lists | |
| - name: Purge cache | |
| run: | | |
| ./.github/scripts/changed-files.sh HEAD^ 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 |