From cd309ba91ea8a47c37a30bcea63286342845c22a Mon Sep 17 00:00:00 2001 From: pandahwang Date: Tue, 1 Oct 2024 20:36:22 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20http.ts=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EC=A3=BC=EC=86=8C=20backend=20ip=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 --- src/http.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/http.ts b/src/http.ts index 53ddeb2..2d6cdda 100644 --- a/src/http.ts +++ b/src/http.ts @@ -1,6 +1,6 @@ // 로스트아크 전체 직업 통계 데이터 조회 export async function fetchOuterData() { - const response = await fetch('http://localhost:8080/statistics/alluser'); + const response = await fetch('http://52.79.232.220:8080/statistics/alluser'); const resData = await response.json(); if(!response.ok){ @@ -12,7 +12,7 @@ export async function fetchOuterData() { // 테스트 대상 전체 직업 통계 데이터 조회 export async function fetchData() { - const response = await fetch('http://localhost:8080/statistics/data'); + const response = await fetch('http://52.79.232.220:8080/statistics/data'); const resData = await response.json(); if(!response.ok){ @@ -24,7 +24,7 @@ export async function fetchData() { export async function postData(url = "", data = {}) { console.log(data); - const response = await fetch(`http://localhost:8080${url}`, { + const response = await fetch(`http://52.79.232.220:8080${url}`, { method: "POST", headers: { "Content-Type": "application/json", @@ -39,7 +39,7 @@ export async function postData(url = "", data = {}) { } export async function getData(url = "") { - const response = await fetch(`http://localhost:8080${url}`); + const response = await fetch(`http://52.79.232.220:8080${url}`); const resData = await response.json(); if(!response.ok){ @@ -50,7 +50,7 @@ export async function getData(url = "") { } export async function deleteData(url = "", data = {}) { - const response = await fetch(`http://localhost:8080${url}`, { + const response = await fetch(`http://52.79.232.220:8080${url}`, { method: "DELETE", headers: { "Content-Type": "application/json", @@ -62,7 +62,7 @@ export async function deleteData(url = "", data = {}) { } export async function updateData(url = "", data = {}) { - const response = await fetch(`http://localhost:8080${url}`, { + const response = await fetch(`http://52.79.232.220:8080${url}`, { method: "PUT", headers: { "Content-Type": "application/json", From 786c9e71ca65ee45eacb6dc5c76168a2dc0b6824 Mon Sep 17 00:00:00 2001 From: pandahwang Date: Tue, 1 Oct 2024 20:36:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?add:=20Github=20Actions=20CI/CD=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a1dd27d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,26 @@ +name: Deploy Frontend To EC2 + +on: + push: + branches: + - dev + +jobs: + Deploy: + runs-on: ubuntu-latest + steps: + - name: SSH(원격 접속)로 EC2에 접속하기 + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.EC2_HOST }} + username: ${{ secrets.EC2_USERNAME }} + key: ${{ secrets.EC2_PRIVATE_KEY }} + script_stop: true + script: | + cd /home/ubuntu/la-front-end + git pull origin dev + rm -rf build + npm install + npm run build + sudo fuser -k -n tcp 3000 || true + npx serve -s build -l 3000 > ./front_output.log 2>&1 &