From 7cfb04c94fbe32c093559ed84f5ea870c7c59feb Mon Sep 17 00:00:00 2001 From: Maria Saladovnikova Date: Wed, 11 Dec 2024 01:09:51 +0000 Subject: [PATCH 1/5] add bff bucket and cloudfront env --- .github/workflows/aws-deployment.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/aws-deployment.yml b/.github/workflows/aws-deployment.yml index 3e197164..bb24e4ee 100644 --- a/.github/workflows/aws-deployment.yml +++ b/.github/workflows/aws-deployment.yml @@ -18,8 +18,12 @@ env: AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} STAGING_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_CLOUDFRONT_DISTRIBUTION_ID }} STAGING_S3_BUCKET: s3://staging.biofile-finder.allencell.org + STAGING_BFF_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_BFF_CLOUDFRONT_DISTRIBUTION_ID }} + STAGING_BFF_S3_BUCKET: s3://staging.bff.allencell.org PRODUCTION_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.PRODUCTION_CLOUDFRONT_DISTRIBUTION_ID }} PRODUCTION_S3_BUCKET: s3://biofile-finder.allencell.org + PRODUCTION_BFF_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.PRODUCTION_BFF_CLOUDFRONT_DISTRIBUTION_ID }} + PRODUCTION_BFF_S3_BUCKET: s3://bff.allencell.org permissions: id-token: write # Required for requesting the JWT and OIDC @@ -91,8 +95,14 @@ jobs: # Note that the command below will copy the files to the root of the S3 bucket e.g., s3://biofile-finder.allencell.org/ # If you want to copy files to a S3 prefix / subdirectory, you would want something like ${{ env.S3_BUCKET }}/your_prefix below - - name: Copy build files to S3 root + - name: Copy build files to biofile-finder S3 run: aws s3 sync ./packages/web/dist ${{ env.S3_BUCKET }} - - name: Invalidate CloudFront cache + - name : Copy build filed to BFF S3 + run : aws s3 sync ./packages/web/dist ${{env.BFF_S3_BUCKET}} + + - name: Invalidate CloudFront biofile-finder cache run: aws cloudfront create-invalidation --distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" + + - name: Invalidate CloudFront BFF cashe + run: aws cloudfront create-invalidation --distibution-id ${{env.BFF_CLOUDFRONT_DISTRIBUTION_ID}} --path "/*" \ No newline at end of file From 50061efab413dc08762493dba0013a9d60eae32e Mon Sep 17 00:00:00 2001 From: Maria Saladovnikova Date: Wed, 11 Dec 2024 01:10:27 +0000 Subject: [PATCH 2/5] add bff bucket and cloudfront env --- .github/workflows/aws-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aws-deployment.yml b/.github/workflows/aws-deployment.yml index bb24e4ee..30849cfd 100644 --- a/.github/workflows/aws-deployment.yml +++ b/.github/workflows/aws-deployment.yml @@ -105,4 +105,4 @@ jobs: run: aws cloudfront create-invalidation --distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" - name: Invalidate CloudFront BFF cashe - run: aws cloudfront create-invalidation --distibution-id ${{env.BFF_CLOUDFRONT_DISTRIBUTION_ID}} --path "/*" \ No newline at end of file + run: aws cloudfront create-invalidation --distribution-id ${{env.BFF_CLOUDFRONT_DISTRIBUTION_ID}} --path "/*" \ No newline at end of file From 2f27df527e773c8c012bdce350ecae7192cfd263 Mon Sep 17 00:00:00 2001 From: Maria Saladovnikova Date: Wed, 11 Dec 2024 20:06:25 +0000 Subject: [PATCH 3/5] remove biofile-finder bucket --- .github/workflows/aws-deployment.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/aws-deployment.yml b/.github/workflows/aws-deployment.yml index 30849cfd..4a1e1a7e 100644 --- a/.github/workflows/aws-deployment.yml +++ b/.github/workflows/aws-deployment.yml @@ -17,13 +17,11 @@ env: AWS_ACCOUNT_ID: ${{ vars.AWS_PUBLIC_DATA_RELEASES_ACCOUNT_ID }} AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} STAGING_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_CLOUDFRONT_DISTRIBUTION_ID }} - STAGING_S3_BUCKET: s3://staging.biofile-finder.allencell.org + STAGING_S3_BUCKET: s3://staging.bff.allencell.org STAGING_BFF_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_BFF_CLOUDFRONT_DISTRIBUTION_ID }} - STAGING_BFF_S3_BUCKET: s3://staging.bff.allencell.org PRODUCTION_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.PRODUCTION_CLOUDFRONT_DISTRIBUTION_ID }} - PRODUCTION_S3_BUCKET: s3://biofile-finder.allencell.org + PRODUCTION_S3_BUCKET: s3://bff.allencell.org PRODUCTION_BFF_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.PRODUCTION_BFF_CLOUDFRONT_DISTRIBUTION_ID }} - PRODUCTION_BFF_S3_BUCKET: s3://bff.allencell.org permissions: id-token: write # Required for requesting the JWT and OIDC @@ -98,11 +96,11 @@ jobs: - name: Copy build files to biofile-finder S3 run: aws s3 sync ./packages/web/dist ${{ env.S3_BUCKET }} - - name : Copy build filed to BFF S3 - run : aws s3 sync ./packages/web/dist ${{env.BFF_S3_BUCKET}} + - name: Copy build filed to BFF S3 + run: aws s3 sync ./packages/web/dist ${{ env.BFF_S3_BUCKET }} - name: Invalidate CloudFront biofile-finder cache run: aws cloudfront create-invalidation --distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" - name: Invalidate CloudFront BFF cashe - run: aws cloudfront create-invalidation --distribution-id ${{env.BFF_CLOUDFRONT_DISTRIBUTION_ID}} --path "/*" \ No newline at end of file + run: aws cloudfront create-invalidation --distribution-id ${{ env.BFF_CLOUDFRONT_DISTRIBUTION_ID }} --path "/*" From cc1743051b4a75499a0a1bef8822dd84de5f9a59 Mon Sep 17 00:00:00 2001 From: Maria Saladovnikova Date: Wed, 11 Dec 2024 20:34:31 +0000 Subject: [PATCH 4/5] clean up --- .github/workflows/aws-deployment.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/aws-deployment.yml b/.github/workflows/aws-deployment.yml index 4a1e1a7e..f380d1e0 100644 --- a/.github/workflows/aws-deployment.yml +++ b/.github/workflows/aws-deployment.yml @@ -91,11 +91,8 @@ jobs: name: aws-deploy-files path: ./packages/web/dist - # Note that the command below will copy the files to the root of the S3 bucket e.g., s3://biofile-finder.allencell.org/ - # If you want to copy files to a S3 prefix / subdirectory, you would want something like ${{ env.S3_BUCKET }}/your_prefix below - - name: Copy build files to biofile-finder S3 - run: aws s3 sync ./packages/web/dist ${{ env.S3_BUCKET }} - + # Note that the command below will copy the files to the root of the S3 bucket e.g., s3://bff.allencell.org/ + # If you want to copy files to a S3 prefix / subdirectory, you would want something like ${{ env.BFF_S3_BUCKET }}/your_prefix below - name: Copy build filed to BFF S3 run: aws s3 sync ./packages/web/dist ${{ env.BFF_S3_BUCKET }} From 5547c2a102d91823c0d377e1f8148bbdfbf6f0e2 Mon Sep 17 00:00:00 2001 From: Maria Saladovnikova Date: Thu, 12 Dec 2024 17:34:49 +0000 Subject: [PATCH 5/5] add comment to biofile-finder's CloudFront --- .github/workflows/aws-deployment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/aws-deployment.yml b/.github/workflows/aws-deployment.yml index f380d1e0..cb8fcc05 100644 --- a/.github/workflows/aws-deployment.yml +++ b/.github/workflows/aws-deployment.yml @@ -93,9 +93,10 @@ jobs: # Note that the command below will copy the files to the root of the S3 bucket e.g., s3://bff.allencell.org/ # If you want to copy files to a S3 prefix / subdirectory, you would want something like ${{ env.BFF_S3_BUCKET }}/your_prefix below - - name: Copy build filed to BFF S3 + - name: Copy build files to BFF S3 run: aws s3 sync ./packages/web/dist ${{ env.BFF_S3_BUCKET }} + # This isn't strictly necessary since this distribution only handles redirects and doesn't serve any content directly - name: Invalidate CloudFront biofile-finder cache run: aws cloudfront create-invalidation --distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"