From cc934f5927d72a16f1ee03358707024c91a04f0c Mon Sep 17 00:00:00 2001 From: Zoonmy Date: Wed, 23 Oct 2024 11:52:37 +0900 Subject: [PATCH] =?UTF-8?q?settings:=20CI/CD=20=EA=B5=AC=EC=B6=95,=20packa?= =?UTF-8?q?ge.json=20ci=3Dfalse=20=EC=84=A4=EC=A0=95=20-=20githubaction=20?= =?UTF-8?q?&=20eslint=20=EA=B0=84=EC=9D=98=20build=20=EC=8B=A4=ED=8C=A8=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=EB=A5=BC=20=EC=9C=84=ED=95=9C=20ci-warning?= =?UTF-8?q?=20false=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/github-action-client.yaml | 37 +++++++++++++++++++++ package.json | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/github-action-client.yaml diff --git a/.github/workflows/github-action-client.yaml b/.github/workflows/github-action-client.yaml new file mode 100644 index 0000000..ca0e188 --- /dev/null +++ b/.github/workflows/github-action-client.yaml @@ -0,0 +1,37 @@ +name: CI/CD Front Pipeline + +on: + push: + branches: [ "master" ] + +# 워크플로우가 저장소의 콘텐츠를 읽을 수 있는 권한을 갖도록 설정 +permissions: + contents: read + +jobs: + Front-Build-Deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Build App + run: | + cd ./src + npm install + npm run build + + - name: Deploy to Prod Server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.EC2_HOST }} + username: ${{ secrets.EC2_USER }} + key: ${{ secrets.EC2_KEY }} + source: "./build/*" # build 폴더 안의 모든 파일을 가리킵니다. + target: "/home/ubuntu/nginx-vol/" # 이 경로는 EC2 서버의 배포 경로입니다. \ No newline at end of file diff --git a/package.json b/package.json index 860e67b..122b137 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ }, "scripts": { "start": "react-scripts start", - "build": "react-scripts build", + "build": "CI=false react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" },