File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Sync to Cloudflare R2
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ workflow_dispatch :
7+
8+ jobs :
9+ sync :
10+ runs-on : ubuntu-latest
11+ env :
12+ AWS_REGION : auto
13+ AWS_S3_FORCE_PATH_STYLE : " true"
14+
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ - name : Configure credentials
19+ run : |
20+ echo "AWS_ACCESS_KEY_ID=${{ secrets.MIRROR_R2_ACCESS_KEY_ID }}" >> $GITHUB_ENV
21+ echo "AWS_SECRET_ACCESS_KEY=${{ secrets.MIRROR_R2_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
22+
23+ - name : Sync to Cloudflare R2
24+ run : |
25+ REPO_NAME="${{ github.event.repository.name }}"
26+ ENDPOINT="https://${{ vars.CF_ACCOUNT_ID }}.r2.cloudflarestorage.com"
27+ DEST="s3://${{ vars.MIRROR_R2_BUCKET }}/${REPO_NAME}"
28+
29+ aws s3 sync . "$DEST" \
30+ --endpoint-url "$ENDPOINT" \
31+ --follow-symlinks \
32+ --delete \
33+ --exact-timestamps \
34+ --exclude "*" \
35+ --include "**/*" \
36+ --exclude ".*" \
37+ --exclude "**/README.md" \
38+ --exclude "**/egg-*.json" \
39+ --exclude "**/meta-*.json"
You can’t perform that action at this time.
0 commit comments