From 8832af548b905272b9f9865ab14eaaf2830967ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=99=ED=98=B8?= <66300965+kdkdhoho@users.noreply.github.com> Date: Fri, 26 Jan 2024 15:56:24 +0900 Subject: [PATCH] =?UTF-8?q?infra:=20=ED=94=84=EB=A1=A0=ED=8A=B8=EC=97=94?= =?UTF-8?q?=EB=93=9C=20=EA=B0=9C=EB=B0=9C=20=EC=84=9C=EB=B2=84=20CI/CD=20?= =?UTF-8?q?=EA=B5=AC=EC=B6=95=20(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * infra: CI Workflow 작성 * infra: Dev-CD workflow 작성 --- .github/workflows/CI.yml | 20 ++++++++++++++++++++ .github/workflows/Dev-CD.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/Dev-CD.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..365233c2 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,20 @@ +name: FrontEnd CI + +on: + pull_request: + branches: [main, dev] + # push: + # branches: [main, dev] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.11.0 + + - run: yarn install + - run: yarn build diff --git a/.github/workflows/Dev-CD.yml b/.github/workflows/Dev-CD.yml new file mode 100644 index 00000000..861b653a --- /dev/null +++ b/.github/workflows/Dev-CD.yml @@ -0,0 +1,30 @@ +name: FrontEnd Dev CD + +on: + push: + branches: [ "dev" ] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20.11.0 + + - run: yarn install + - run: yarn build + + - name: S3 and CloudFront Deploy + uses: Reggionick/s3-deploy@v4 + with: + folder: .next + bucket: ${{ secrets.DEV_S3_BUCKET_NAME }} + bucket-region: ${{ secrets.AWS_DEFAULT_REGION }} + dist-id: ${{ secrets.DEV_CLOUDFRONT_ID }}