Skip to content

Commit

Permalink
fix(cors): bucket issue (#3922)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Philibeaux <[email protected]>
  • Loading branch information
philibea authored Jun 26, 2024
1 parent e90989a commit d72fa0c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .aws/cors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"CORSRules": [
{
"AllowedMethods": ["GET", "POST", "PUT"],
"AllowedHeaders": ["*"],
"AllowedOrigins": ["*"]
}
]
}
6 changes: 4 additions & 2 deletions .github/workflows/illustrations-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ jobs:
- name: AWS CLI configuration
run: |
mkdir ~/.aws
cp ./.aws/config ~/.aws/config
cp ./.aws/* ~/.aws/
sed -i -e 's/${BUCKET_REGION}/${{env.BUCKET_REGION}}/g' ~/.aws/config
- name: Upload illustrations on bucket
run: aws s3 sync packages/illustrations/src/assets s3://${{ env.BUCKET_NAME }}/illustrations/ --exclude "*" --include "*.webp" --include "*.svg" --acl public-read --cache-control max-age=2592000,public
run: |
aws s3 sync packages/illustrations/src/assets s3://${{ env.BUCKET_NAME }}/illustrations/ --exclude "*" --include "*.webp" --include "*.svg" --acl public-read --cache-control max-age=2592000,public
aws s3api put-bucket-cors --bucket ${{ env.BUCKET_NAME }} --cors-configuration file://.aws/cors.json
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm-lock.yaml
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@
"*.svg": [
"pnpm run svg"
],
"*.y(a)ml": [
"*.y?(a)ml": [
"pnpm dlx prettier --write '**/*.{yml,yaml}' --single-quote"
],
".md?(x)": [
"pnpm dlx prettier --write '**/*.{md,mdx}' --single-quote"
]
},
"config": {
Expand Down

0 comments on commit d72fa0c

Please sign in to comment.