From 45ab8e12d4ee682cfdcd2baaeea7ad0a1c1ba53b Mon Sep 17 00:00:00 2001 From: Lin Date: Sun, 29 Dec 2024 21:43:38 +0900 Subject: [PATCH 01/10] =?UTF-8?q?Deploy:=20PR=20preview=20url=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20workflows=20=EA=B5=AC=EC=B6=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/preview.yml diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml new file mode 100644 index 00000000..0e50bff0 --- /dev/null +++ b/.github/workflows/preview.yml @@ -0,0 +1,63 @@ +name: preview-url + +permissions: + pull-requests: write + contents: read + +on: + pull_request: + branches: [develop] + +jobs: + preview: + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "pnpm" + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 8 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Generate Environment Variables File + run: | + echo "NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL" >> apps/web/.env.production.local + env: + NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} + + - name: Build + run: pnpm -filter=web build + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Deploy to S3 with PR-specific prefix + run: aws s3 sync ./${{ secrets.BUILD_DIRECTORY }} s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --delete + + - name: CloudFront Invalidate Cache + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths '/*' + + - name: Add Preview URL as a Comment + uses: marocchino/sticky-pull-request-comment@v2 + with: + message: | + ## 🚀 Preview URL + + **Branch:** ${{ github.head_ref }} + **Commit:** ${{ github.sha }} + + Preview URL: https://codeit.click?pr=${{ github.event.pull_request.number }} From 740e6e54f37fbbb39883ecb71140c3053ccbf354 Mon Sep 17 00:00:00 2001 From: Lin Date: Sun, 29 Dec 2024 21:56:49 +0900 Subject: [PATCH 02/10] =?UTF-8?q?Fix:=20pnpm=20=EC=84=A4=EC=B9=98=EB=A5=BC?= =?UTF-8?q?=20Node.js=20=EC=84=A4=EC=A0=95=20=EC=A0=84=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 0e50bff0..ed12c0c9 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -15,17 +15,17 @@ jobs: - name: Git Checkout uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 8 + - name: Use Node.js uses: actions/setup-node@v4 with: node-version: "20.x" cache: "pnpm" - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 8 - - name: Install dependencies run: pnpm install --frozen-lockfile From 38be2ab3cc6cf4aad87c01de4ad25d442839b49a Mon Sep 17 00:00:00 2001 From: Lin Date: Sun, 29 Dec 2024 22:02:41 +0900 Subject: [PATCH 03/10] =?UTF-8?q?Fix:=20pnpm/action-setup=20=EC=95=A1?= =?UTF-8?q?=EC=85=98=EC=9D=98=20version=EC=9D=84=20package.json=EC=9D=98?= =?UTF-8?q?=20packageManager=20=EB=B2=84=EC=A0=84=EA=B3=BC=20=EC=9D=BC?= =?UTF-8?q?=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index ed12c0c9..da3d5f33 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -18,7 +18,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 8 + version: 8.15.6 - name: Use Node.js uses: actions/setup-node@v4 From c8341a6781036580ea5af1d8961a21c5c1d071ad Mon Sep 17 00:00:00 2001 From: Lin Date: Sun, 29 Dec 2024 22:26:35 +0900 Subject: [PATCH 04/10] =?UTF-8?q?Fix:=20packageManager=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20pnpm@9.12.1=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 --- package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 90b16a13..fce28123 100644 --- a/package.json +++ b/package.json @@ -22,13 +22,9 @@ "turbo": "^2.2.1", "typescript": "^5.6.3" }, - "packageManager": "pnpm@8.15.6", + "packageManager": "pnpm@9.12.1", "engines": { "node": ">=18" }, - "prettier": "@org/prettier-config", - "workspaces": [ - "packages/*", - "apps/*" - ] + "prettier": "@org/prettier-config" } From 9ca96593009a3c0c512ae542c7c55508834ba1db Mon Sep 17 00:00:00 2001 From: Lin Date: Sun, 29 Dec 2024 22:27:54 +0900 Subject: [PATCH 05/10] =?UTF-8?q?Fix:=20pnpm=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=9D=BC=EC=B9=98=EC=8B=9C=ED=82=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index da3d5f33..1e15353f 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -18,7 +18,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 8.15.6 + version: 9.12.1 - name: Use Node.js uses: actions/setup-node@v4 From eabfface81ed0345a8bbe9799ef71627ad9775e3 Mon Sep 17 00:00:00 2001 From: Lin Date: Sun, 29 Dec 2024 23:56:09 +0900 Subject: [PATCH 06/10] =?UTF-8?q?Refactor:=20=EC=A0=84=EC=B2=B4=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EB=AC=B4=ED=9A=A8=ED=99=94=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=8A=B9=EC=A0=95=20=EA=B2=BD=EB=A1=9C=20=EB=AC=B4?= =?UTF-8?q?=ED=9A=A8=ED=99=94=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 1e15353f..c91a5aef 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -49,7 +49,7 @@ jobs: run: aws s3 sync ./${{ secrets.BUILD_DIRECTORY }} s3://${{ secrets.AWS_S3_BUCKET_NAME }}/pr-${{ github.event.pull_request.number }} --delete - name: CloudFront Invalidate Cache - run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths '/*' + run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/pr-${{ github.event.pull_request.number }}/*" - name: Add Preview URL as a Comment uses: marocchino/sticky-pull-request-comment@v2 From c7e3ca80f24619d4a316db6cfe1fb9ee139997df Mon Sep 17 00:00:00 2001 From: Lin Date: Tue, 31 Dec 2024 10:34:50 +0900 Subject: [PATCH 07/10] =?UTF-8?q?Deploy:=20AWS=20Credentials=20=EC=95=A1?= =?UTF-8?q?=EC=85=98=20=EB=B2=84=EC=A0=84=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index c91a5aef..b2e11333 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -39,7 +39,7 @@ jobs: run: pnpm -filter=web build - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 + uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} From 6af2a1e5f5495cfddcea14ba9f2f1528d8f450b6 Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 1 Jan 2025 13:41:14 +0900 Subject: [PATCH 08/10] =?UTF-8?q?Fix:=20pnpm=20version=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b2e11333..9aea51cd 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -18,7 +18,7 @@ jobs: - name: Install pnpm uses: pnpm/action-setup@v4 with: - version: 9.12.1 + version: 8.15.6 - name: Use Node.js uses: actions/setup-node@v4 From ccd73324d9a774db3c81bd5fe067e231dd4b0e0e Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 1 Jan 2025 13:42:29 +0900 Subject: [PATCH 09/10] =?UTF-8?q?Chore:=20workspaces=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fce28123..90b16a13 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,13 @@ "turbo": "^2.2.1", "typescript": "^5.6.3" }, - "packageManager": "pnpm@9.12.1", + "packageManager": "pnpm@8.15.6", "engines": { "node": ">=18" }, - "prettier": "@org/prettier-config" + "prettier": "@org/prettier-config", + "workspaces": [ + "packages/*", + "apps/*" + ] } From 48b5da6a5ee9f79e0d3305fbb8c5ace2f72d742a Mon Sep 17 00:00:00 2001 From: Lin Date: Wed, 1 Jan 2025 13:49:15 +0900 Subject: [PATCH 10/10] =?UTF-8?q?Chore:=20--frozen-lockfile=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 9aea51cd..45dd2855 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -27,7 +27,7 @@ jobs: cache: "pnpm" - name: Install dependencies - run: pnpm install --frozen-lockfile + run: pnpm install - name: Generate Environment Variables File run: |