From d72fa0c75df8620f997935392e47d4905633c32d Mon Sep 17 00:00:00 2001 From: philibeaux Date: Wed, 26 Jun 2024 17:46:17 +0200 Subject: [PATCH] fix(cors): bucket issue (#3922) Signed-off-by: Alexandre Philibeaux --- .aws/cors.json | 9 +++++++++ .github/workflows/illustrations-upload.yml | 6 ++++-- .prettierignore | 1 + package.json | 5 ++++- 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 .aws/cors.json create mode 100644 .prettierignore diff --git a/.aws/cors.json b/.aws/cors.json new file mode 100644 index 0000000000..6e7da1ada7 --- /dev/null +++ b/.aws/cors.json @@ -0,0 +1,9 @@ +{ + "CORSRules": [ + { + "AllowedMethods": ["GET", "POST", "PUT"], + "AllowedHeaders": ["*"], + "AllowedOrigins": ["*"] + } + ] +} diff --git a/.github/workflows/illustrations-upload.yml b/.github/workflows/illustrations-upload.yml index 4d93bad356..93ec723a94 100644 --- a/.github/workflows/illustrations-upload.yml +++ b/.github/workflows/illustrations-upload.yml @@ -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 }} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..bd5535a603 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +pnpm-lock.yaml diff --git a/package.json b/package.json index de15383d06..7f32790715 100644 --- a/package.json +++ b/package.json @@ -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": {