Skip to content

Commit 76a95c7

Browse files
committed
chore(ci): deploy manifests to R2 immediately after generation
1 parent 28be034 commit 76a95c7

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/generate-manifests-from-r2.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,27 @@ jobs:
8282
--r2-access-key="$R2_ACCESS_KEY" \
8383
--r2-secret-key="$R2_SECRET_KEY"
8484
85+
- name: Deploy manifests to R2
86+
if: ${{ github.event_name != 'workflow_dispatch' || !inputs.dry_run }}
87+
env:
88+
R2_ENDPOINT: https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
89+
R2_BUCKET: ${{ secrets.CLOUDFLARE_R2_MANIFESTS_BUCKET }}
90+
run: |
91+
aws configure set aws_access_key_id ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
92+
aws configure set aws_secret_access_key ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
93+
aws configure set default.region auto
94+
95+
echo "Deploying manifests to R2..."
96+
for file in src/internal/manifest/data/*.json; do
97+
filename=$(basename "$file")
98+
echo "Uploading $filename..."
99+
aws s3 cp "$file" "s3://${R2_BUCKET}/${filename}" \
100+
--endpoint-url "${R2_ENDPOINT}" \
101+
--content-type "application/json" \
102+
--cache-control "public, max-age=300"
103+
done
104+
echo "Manifests deployed to R2!"
105+
85106
- name: Check for changes
86107
id: check-changes
87108
if: ${{ github.event_name != 'workflow_dispatch' || !inputs.dry_run }}
@@ -119,7 +140,9 @@ jobs:
119140
if [ "${{ inputs.dry_run }}" = "true" ]; then
120141
echo "**Mode:** Dry run (no changes made)" >> $GITHUB_STEP_SUMMARY
121142
elif [ "${{ steps.check-changes.outputs.changed }}" = "true" ]; then
122-
echo "**Result:** Changes detected, PR created" >> $GITHUB_STEP_SUMMARY
143+
echo "**Result:** Changes detected" >> $GITHUB_STEP_SUMMARY
144+
echo "- Manifests deployed to R2 (live immediately)" >> $GITHUB_STEP_SUMMARY
145+
echo "- PR created for embedded manifests" >> $GITHUB_STEP_SUMMARY
123146
else
124147
echo "**Result:** No changes detected" >> $GITHUB_STEP_SUMMARY
125148
fi

0 commit comments

Comments
 (0)