Skip to content

Commit

Permalink
Merge branch 'main' into feature/local_cloud_toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianWhitneyAI authored Dec 20, 2024
2 parents 4e48e39 + 5b48bca commit bbcd3e9
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 173 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/aws-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +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 }}
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 }}

permissions:
id-token: write # Required for requesting the JWT and OIDC
Expand Down Expand Up @@ -75,9 +77,11 @@ jobs:
if [ "${{ github.event.inputs.environment }}" == "production" ]; then
echo "S3_BUCKET=${{ env.PRODUCTION_S3_BUCKET }}" >> $GITHUB_ENV
echo "CLOUDFRONT_DISTRIBUTION_ID=${{ env.PRODUCTION_CLOUDFRONT_DISTRIBUTION_ID }}" >> $GITHUB_ENV
echo "BFF_CLOUDFRONT_DISTRIBUTION_ID=${{ env.PRODUCTION_BFF_CLOUDFRONT_DISTRIBUTION_ID }}" >> $GITHUB_ENV
elif [ "${{ github.event.inputs.environment }}" == "staging" ]; then
echo "S3_BUCKET=${{ env.STAGING_S3_BUCKET }}" >> $GITHUB_ENV
echo "CLOUDFRONT_DISTRIBUTION_ID=${{ env.STAGING_CLOUDFRONT_DISTRIBUTION_ID }}" >> $GITHUB_ENV
echo "BFF_CLOUDFRONT_DISTRIBUTION_ID=${{ env.STAGING_BFF_CLOUDFRONT_DISTRIBUTION_ID }}" >> $GITHUB_ENV
else
echo "Invalid environment specified"
exit 1
Expand All @@ -89,10 +93,14 @@ 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 S3 root
# 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 files to BFF S3
run: aws s3 sync ./packages/web/dist ${{ env.S3_BUCKET }}

- name: Invalidate CloudFront cache
# 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 "/*"

- name: Invalidate CloudFront BFF cache
run: aws cloudfront create-invalidation --distribution-id ${{ env.BFF_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ build
*.log
*.tgz
.env
mise.toml
167 changes: 25 additions & 142 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"filesize": "5.0.x",
"fuse.js": "3.4.x",
"interactjs": "1.6.x",
"jszip": "^3.10.1",
"lodash": "4.17.x",
"lru-cache": "5.1.x",
"normalize.css": "8.0.x",
Expand Down
Loading

0 comments on commit bbcd3e9

Please sign in to comment.