From db7ee7b688adf83ae37ad54db428936e29ce5097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Sun, 23 Mar 2025 18:02:21 +0900 Subject: [PATCH 01/12] =?UTF-8?q?=EA=B0=80=EB=8F=85=EC=84=B1=20=ED=96=A5?= =?UTF-8?q?=EC=83=81=EC=9D=84=20=EC=9C=84=ED=95=B4=20workflow=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=ED=95=9C=EA=B8=80=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 2 +- .github/workflows/cd.yaml | 2 +- .github/workflows/delete-feat-bucket.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 9208314..195b66e 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -1,4 +1,4 @@ -name: Manage S3 Buckets for Feature Branch PRs +name: feature 브랜치 전용 S3 버킷 상태 관리 on: pull_request: diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index ac4844c..8c6fdc1 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -1,4 +1,4 @@ -name: Build and Upload to S3 +name: 빌드 및 S3 업로드 on: push: diff --git a/.github/workflows/delete-feat-bucket.yaml b/.github/workflows/delete-feat-bucket.yaml index cef8e44..0d0c22e 100644 --- a/.github/workflows/delete-feat-bucket.yaml +++ b/.github/workflows/delete-feat-bucket.yaml @@ -1,4 +1,4 @@ -name: Delete S3 Buckets for Merged Branch +name: 작업 완료된 feature 브랜치의 S3 버킷 삭제 on: pull_request: From 68f494c97b049ca95daad0e68989e630ab0dbb8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Sun, 23 Mar 2025 19:53:32 +0900 Subject: [PATCH 02/12] =?UTF-8?q?feat=20=EB=B8=8C=EB=9E=9C=EC=B9=98?= =?UTF-8?q?=EB=A5=BC=20=EA=B0=9C=EB=B3=84=20=EB=B2=84=ED=82=B7=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B0=B0=ED=8F=AC=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 195b66e..7623086 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -37,8 +37,12 @@ jobs: env: FEATURE_BRANCH: ${{ github.head_ref }} run: | - # feat/ 이후의 문자열만 추출 + # feat/ 이후의 문자열만 추출, empty string일 경우 exit BUCKET_NAME=$(echo $FEATURE_BRANCH | sed 's|^feat/||') + if [ -z "$BUCKET_NAME" ]; then + echo "Bucket name is not set properly. Exiting." + exit 1 + fi echo "Bucket name determined: $BUCKET_NAME" # For debugging echo "bucket=$BUCKET_NAME" >> $GITHUB_ENV @@ -46,15 +50,37 @@ jobs: env: S3_BUCKET: zipline-fe-${{ env.bucket }} run: | - if [ "${{ github.event.action }}" = "opened" ] || [ "${{ github.event.action }}" = "reopened" ]; then + if [ "${{ github.event.action }}" = "opened" ]; then echo "Deploying and creating S3 bucket: $S3_BUCKET" aws s3api create-bucket --bucket $S3_BUCKET --region ap-northeast-2 --create-bucket-configuration LocationConstraint=ap-northeast-2 + aws s3api put-bucket-website --bucket $S3_BUCKET --website-configuration '{ + "IndexDocument": { + "Suffix": "index.html" + } + }' + + aws s3api put-bucket-policy --bucket $S3_BUCKET --policy '{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": "*", + "Action": "s3:GetObject", + "Resource": "arn:aws:s3:::'$S3_BUCKET'/*" + } + ] + }' + + aws s3api delete-public-access-block --bucket $S3_BUCKET + aws s3 sync ./dist s3://$S3_BUCKET/ --delete - elif [ "${{ github.event.action }}" = "synchronize" ]; then + + elif [ "${{ github.event.action }}" = "reopened" ] || [ "${{ github.event.action }}" = "synchronize" ]; then echo "Sync local job and S3 bucket: $S3_BUCKET" aws s3 sync ./dist s3://$S3_BUCKET/ --delete elif [ "${{ github.event.action }}" = "closed" ] && [ "${{ github.event.pull_request.merged }}" = "true" ]; then echo "Deleting S3 bucket: $S3_BUCKET" + aws s3 rm s3://$S3_BUCKET --recursive aws s3 rb s3://$S3_BUCKET --force else echo "No action needed" From 9e2cbea4914f5f39edebe127fece952201e799f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 11:11:17 +0900 Subject: [PATCH 03/12] =?UTF-8?q?=EB=B2=84=ED=82=B7=EB=B3=84=EB=A1=9C=20?= =?UTF-8?q?=EB=B0=B0=ED=8F=AC=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EB=B2=84=ED=82=B7=20=EC=84=A4=EC=A0=95=20=EB=AA=85?= =?UTF-8?q?=EB=A0=B9=EC=96=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 7623086..f772901 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -44,21 +44,21 @@ jobs: exit 1 fi echo "Bucket name determined: $BUCKET_NAME" # For debugging - echo "bucket=$BUCKET_NAME" >> $GITHUB_ENV + + - name: Create Bucket + continue-on-error: true + run: | + aws s3api create-bucket --bucket $S3_BUCKET --region ap-northeast-2 --create-bucket-configuration LocationConstraint=ap-northeast-2 - name: Handle Build Deployment and S3 Buckets env: - S3_BUCKET: zipline-fe-${{ env.bucket }} + S3_BUCKET: zipline-fe-${{ env.BUCKET_NAME }} run: | if [ "${{ github.event.action }}" = "opened" ]; then - echo "Deploying and creating S3 bucket: $S3_BUCKET" - aws s3api create-bucket --bucket $S3_BUCKET --region ap-northeast-2 --create-bucket-configuration LocationConstraint=ap-northeast-2 - aws s3api put-bucket-website --bucket $S3_BUCKET --website-configuration '{ - "IndexDocument": { - "Suffix": "index.html" - } - }' + echo "Set S3 bucket config: $S3_BUCKET" + aws s3api delete-public-access-block --bucket $S3_BUCKET + aws s3api put-bucket-policy --bucket $S3_BUCKET --policy '{ "Version": "2012-10-17", "Statement": [ @@ -71,7 +71,7 @@ jobs: ] }' - aws s3api delete-public-access-block --bucket $S3_BUCKET + aws s3 website $S3_BUCKET --index-document index.html --error-document index.html aws s3 sync ./dist s3://$S3_BUCKET/ --delete From 7475241a13c7404cfd0f5beb97baac1febc6e652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 11:14:00 +0900 Subject: [PATCH 04/12] =?UTF-8?q?=EB=88=84=EB=9D=BD=ED=95=9C=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20=EB=B3=80=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index f772901..f275fe9 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -46,6 +46,8 @@ jobs: echo "Bucket name determined: $BUCKET_NAME" # For debugging - name: Create Bucket + env: + S3_BUCKET: zipline-fe-${{ env.BUCKET_NAME }} continue-on-error: true run: | aws s3api create-bucket --bucket $S3_BUCKET --region ap-northeast-2 --create-bucket-configuration LocationConstraint=ap-northeast-2 From 31124b7592ea4963ef92a181838b9507087af9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 11:28:23 +0900 Subject: [PATCH 05/12] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 36 ++++++++++++++-------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index f275fe9..880d584 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -33,31 +33,28 @@ jobs: aws-region: ap-northeast-2 - name: Determine S3 bucket name with branch name - id: extract-bucket-name + id: generate-bucket-name env: FEATURE_BRANCH: ${{ github.head_ref }} run: | # feat/ 이후의 문자열만 추출, empty string일 경우 exit - BUCKET_NAME=$(echo $FEATURE_BRANCH | sed 's|^feat/||') - if [ -z "$BUCKET_NAME" ]; then - echo "Bucket name is not set properly. Exiting." - exit 1 - fi - echo "Bucket name determined: $BUCKET_NAME" # For debugging + BUCKET_NAME=$(echo "${{ github.head_ref }}" | + sed -e 's/feat\///' | # feat/ 접두사 제거 + tr '[:upper:]' '[:lower:]' | # 대문자를 소문자로 변환 + sed -e 's/[^a-z0-9-]/-/g' | # 허용되지 않는 문자를 대시로 대체 + sed -e 's/^-*//; s/-*$//' | # 시작과 끝의 대시 제거 + cut -c1-50) # 최대 길이 제한 - - name: Create Bucket - env: - S3_BUCKET: zipline-fe-${{ env.BUCKET_NAME }} - continue-on-error: true - run: | - aws s3api create-bucket --bucket $S3_BUCKET --region ap-northeast-2 --create-bucket-configuration LocationConstraint=ap-northeast-2 + echo "bucket-name=zipline-fe-$BUCKET_NAME" >> $GITHUB_OUTPUT - - name: Handle Build Deployment and S3 Buckets + - name: Manage S3 Buckets env: - S3_BUCKET: zipline-fe-${{ env.BUCKET_NAME }} + S3_BUCKET: ${{ steps.generate-bucket-name.outputs.bucket-name }} run: | - if [ "${{ github.event.action }}" = "opened" ]; then + if [[ "${{ github.event.action }}" == "opened" || "${{ github.event.action }}" == "reopened" || "${{ github.event.action }}" == "synchronize" ]]; then echo "Set S3 bucket config: $S3_BUCKET" + if ! aws s3api head-bucket --bucket $S3_BUCKET 2>/dev/null; then + aws s3api create-bucket --bucket $S3_BUCKET --region ap-northeast-2 --create-bucket-configuration LocationConstraint=ap-northeast-2 aws s3api delete-public-access-block --bucket $S3_BUCKET @@ -73,13 +70,10 @@ jobs: ] }' - aws s3 website $S3_BUCKET --index-document index.html --error-document index.html - + aws s3 website s3://$S3_BUCKET --index-document index.html --error-document index.html + aws s3 sync ./dist s3://$S3_BUCKET/ --delete - elif [ "${{ github.event.action }}" = "reopened" ] || [ "${{ github.event.action }}" = "synchronize" ]; then - echo "Sync local job and S3 bucket: $S3_BUCKET" - aws s3 sync ./dist s3://$S3_BUCKET/ --delete elif [ "${{ github.event.action }}" = "closed" ] && [ "${{ github.event.pull_request.merged }}" = "true" ]; then echo "Deleting S3 bucket: $S3_BUCKET" aws s3 rm s3://$S3_BUCKET --recursive From 2e31d07b030ad70389b530e87c13396819231c50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 11:41:02 +0900 Subject: [PATCH 06/12] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20-=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 880d584..3416a91 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -71,7 +71,8 @@ jobs: }' aws s3 website s3://$S3_BUCKET --index-document index.html --error-document index.html - + fi + aws s3 sync ./dist s3://$S3_BUCKET/ --delete elif [ "${{ github.event.action }}" = "closed" ] && [ "${{ github.event.pull_request.merged }}" = "true" ]; then From 9933d498ec30f00ca1f3d4bb401c9c5dd7865734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 11:43:03 +0900 Subject: [PATCH 07/12] =?UTF-8?q?=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20-=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.css b/src/App.css index b9d355d..41089ec 100644 --- a/src/App.css +++ b/src/App.css @@ -3,6 +3,7 @@ margin: 0 auto; padding: 2rem; text-align: center; + background: aqua; } .logo { From 8d5a38fa7c8bcf943fa2d4c4d3c0b1e3b6d0a927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 12:26:21 +0900 Subject: [PATCH 08/12] =?UTF-8?q?=EC=BD=94=EB=A9=98=ED=8A=B8=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 8 ++++++++ .github/workflows/preview-comment.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/preview-comment.yaml diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 3416a91..0f765f3 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -82,3 +82,11 @@ jobs: else echo "No action needed" fi + + reusable_cd: + needs: cd-feat + if: github.event.action == 'opened' + uses: ./.github/workflows/preview-comment.yaml + with: + bucket_name: $S3_BUCKET + pr_number: ${{ github.event.pull_request.number }}" diff --git a/.github/workflows/preview-comment.yaml b/.github/workflows/preview-comment.yaml new file mode 100644 index 0000000..c393bbc --- /dev/null +++ b/.github/workflows/preview-comment.yaml @@ -0,0 +1,24 @@ +name: PR에 Feature 브랜치 주소 코멘트 추가 + +on: + workflow_call: + inputs: + bucket_name: + required: true + type: string + pr_number: + required: true + type: number + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: comment PR + uses: thollander/actions-comment-pull-request@v3 + with: + message: "🍐 배포 주소: ${{ inputs.bucket_name }}.s3-website.ap-northeast-2.amazonaws.com/" + pr-number: ${{ inputs.bucket_name}} From 95e821ee32d43f5f0ec586ae11f32c84153eb3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 12:29:44 +0900 Subject: [PATCH 09/12] =?UTF-8?q?=EC=BD=94=EB=A9=98=ED=8A=B8=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 0f765f3..68b8531 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -83,10 +83,10 @@ jobs: echo "No action needed" fi - reusable_cd: + comment_s3_address: needs: cd-feat if: github.event.action == 'opened' uses: ./.github/workflows/preview-comment.yaml with: bucket_name: $S3_BUCKET - pr_number: ${{ github.event.pull_request.number }}" + pr_number: ${{ github.event.pull_request.number }} From 920a1025df97bab1a04e02ff1fc27e6cf3a02c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 12:43:18 +0900 Subject: [PATCH 10/12] test --- .github/workflows/cd-feat.yaml | 8 +++++--- .github/workflows/preview-comment.yaml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 68b8531..7f2e1f4 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -9,6 +9,8 @@ on: jobs: cd-feat: runs-on: ubuntu-latest + outputs: + bucket_name: ${{ steps.generate-bucket-name.outputs.bucket_name }} steps: - name: Checkout the code @@ -75,7 +77,7 @@ jobs: aws s3 sync ./dist s3://$S3_BUCKET/ --delete - elif [ "${{ github.event.action }}" = "closed" ] && [ "${{ github.event.pull_request.merged }}" = "true" ]; then + elif [[ "${{ github.event.action }}" = "closed" ] && [ "${{ github.event.pull_request.merged }}" = "true" ]]; then echo "Deleting S3 bucket: $S3_BUCKET" aws s3 rm s3://$S3_BUCKET --recursive aws s3 rb s3://$S3_BUCKET --force @@ -83,10 +85,10 @@ jobs: echo "No action needed" fi - comment_s3_address: + add_comment: needs: cd-feat if: github.event.action == 'opened' uses: ./.github/workflows/preview-comment.yaml with: - bucket_name: $S3_BUCKET + bucket_name: ${{ needs.cd-feat.outputs.bucket_name }} pr_number: ${{ github.event.pull_request.number }} diff --git a/.github/workflows/preview-comment.yaml b/.github/workflows/preview-comment.yaml index c393bbc..3879879 100644 --- a/.github/workflows/preview-comment.yaml +++ b/.github/workflows/preview-comment.yaml @@ -11,7 +11,7 @@ on: type: number jobs: - comment: + s3_address: runs-on: ubuntu-latest steps: - name: Checkout @@ -21,4 +21,4 @@ jobs: uses: thollander/actions-comment-pull-request@v3 with: message: "🍐 배포 주소: ${{ inputs.bucket_name }}.s3-website.ap-northeast-2.amazonaws.com/" - pr-number: ${{ inputs.bucket_name}} + pr-number: ${{ inputs.pr_number}} From ed1a94478beaabf35ae52a9843d12cdb89d98a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 12:45:48 +0900 Subject: [PATCH 11/12] test-2 --- .github/workflows/cd-feat.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 7f2e1f4..265eab5 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -50,8 +50,10 @@ jobs: echo "bucket-name=zipline-fe-$BUCKET_NAME" >> $GITHUB_OUTPUT - name: Manage S3 Buckets + continue-on-error: true env: S3_BUCKET: ${{ steps.generate-bucket-name.outputs.bucket-name }} + run: | if [[ "${{ github.event.action }}" == "opened" || "${{ github.event.action }}" == "reopened" || "${{ github.event.action }}" == "synchronize" ]]; then echo "Set S3 bucket config: $S3_BUCKET" From 3c3223a544b9ab7590ede403bbc310d4eb5c6fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EC=A7=80=EC=9B=90?= Date: Tue, 25 Mar 2025 12:49:47 +0900 Subject: [PATCH 12/12] =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd-feat.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cd-feat.yaml b/.github/workflows/cd-feat.yaml index 265eab5..be786e6 100644 --- a/.github/workflows/cd-feat.yaml +++ b/.github/workflows/cd-feat.yaml @@ -50,7 +50,6 @@ jobs: echo "bucket-name=zipline-fe-$BUCKET_NAME" >> $GITHUB_OUTPUT - name: Manage S3 Buckets - continue-on-error: true env: S3_BUCKET: ${{ steps.generate-bucket-name.outputs.bucket-name }} @@ -79,7 +78,7 @@ jobs: aws s3 sync ./dist s3://$S3_BUCKET/ --delete - elif [[ "${{ github.event.action }}" = "closed" ] && [ "${{ github.event.pull_request.merged }}" = "true" ]]; then + elif [[ "${{ github.event.action }}" = "closed" && "${{ github.event.pull_request.merged }}" = "true" ]]; then echo "Deleting S3 bucket: $S3_BUCKET" aws s3 rm s3://$S3_BUCKET --recursive aws s3 rb s3://$S3_BUCKET --force