Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(workflows/pr-review-companion): optimize GCS upload #38419

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/pr-review-companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
if: hashFiles('build/') != ''
run: |
echo "HAS_ARTIFACT=true" >> "$GITHUB_ENV"
PR_NUMBER=`cat build/NR`
echo "PREFIX=pr$PR_NUMBER" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
if: env.HAS_ARTIFACT
Expand Down Expand Up @@ -143,10 +145,12 @@ jobs:
if: env.HAS_ARTIFACT
uses: google-github-actions/setup-gcloud@v2

- name: Sync build with GCS
- name: Upload to GCS
if: env.HAS_ARTIFACT
run: |-
PR_NUMBER=`cat build/NR`
PREFIX="pr$PR_NUMBER"
gsutil -q -m -h "Cache-Control: public, max-age=3600" cp -r build/static "gs://content-review-mdn/$PREFIX/"
gsutil -q -m -h "Cache-Control: public, max-age=3600" rsync -cdrj html,json,txt -y "^static/" build "gs://content-review-mdn/$PREFIX"
uses: google-github-actions/upload-cloud-storage@v2
with:
path: "build"
destination: "${{ vars.GCP_BUCKET_NAME }}/${{ env.PREFIX }}"
resumable: false
concurrency: 500
process_gcloudignore: false
Loading