Skip to content

Commit

Permalink
test-1
Browse files Browse the repository at this point in the history
  • Loading branch information
wlstmd committed Aug 26, 2024
1 parent e91a7da commit f3a3f5c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 94 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ jobs:
node-version: "18.x"

- name: Install Dependencies
working-directory: ./backend # package.json 파일이 있는 디렉토리로 설정
working-directory: ./backend
run: npm install

- name: Build the application
working-directory: ./backend # 빌드 명령어도 동일한 디렉토리에서 실행
working-directory: ./backend
run: npm run build

- name: Deploy to Azure App Service
uses: azure/webapps-deploy@v2
with:
app-name: cdc
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ./backend # 배포할 디렉토리 설정
package: ./backend
env:
DB_HOST: "jinseung-db.mysql.database.azure.com"
DB_PORT: "3306"
DB_USERNAME: "adminuser@jinseung-db"
DB_PASSWORD: "cloud24admin!!"
DB_DATABASE: "cdc"
JWT_SECRET: "Secret"
JWT_ACCESS_TOKEN_EXPIRATION: "2h"
JWT_REFRESH_TOKEN_EXPIRATION: "10d"
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_DATABASE: ${{ secrets.DB_DATABASE }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
JWT_ACCESS_TOKEN_EXPIRATION: ${{ secrets.JWT_ACCESS_TOKEN_EXPIRATION }}
JWT_REFRESH_TOKEN_EXPIRATION: ${{ secrets.JWT_REFRESH_TOKEN_EXPIRATION }}
53 changes: 45 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ azd up
3. 다음과 같이 github workflow 시크릿을 설정합니다. (윈도우 기준)

```ps1
# Spring Boot Deploy
az webapp deployment list-publishing-profiles --name "$AZURE_ENV_NAME-app" --resource-group $AZURE_RESOURCE_GROUP --xml > publish_profile.xml
gh auth login
gh secret set AZURE_APP_NAME --repo hackersground-kr/hg-CDC-team --body "$AZURE_ENV_NAME"
cat publish_profile.xml | gh secret set AZURE_WEBAPP_PUBLISH_PROFILE --repo hackersground-kr/hg-CDC-team
# AI Deploy
az webapp deployment list-publishing-profiles --name "$AZURE_ENV_NAME-ai" --resource-group $AZURE_RESOURCE_GROUP --xml > ai_publish_profile.xml
Expand Down Expand Up @@ -135,5 +128,49 @@ yarn
3. yarn 명령어를 이용해 프론트엔드를 시작해줍니다.

```
yarn start
yarn start # 로컬에서 잘 실행되는지 확인 해주세요.
```

4. 로컬에서 잘 실행된다면 배포단계로 넘어갑니다

<img alt="스크린샷 2024-08-27 오전 12 37 42" src="https://github.com/user-attachments/assets/affb9106-16b1-443b-af18-fd6e10b96c9b">

`Azure Portal에 접속해 App Service를 클릭합니다.`

<img width="317" alt="스크린샷 2024-08-27 오전 12 39 05" src="https://github.com/user-attachments/assets/b6ec7fb3-2331-43a2-8612-f8e36db7da83">

`App Service에서 만들기 > "웹 앱" 을 선택해줍니다.`
<img width="815" alt="스크린샷 2024-08-27 오전 12 40 07" src="https://github.com/user-attachments/assets/724efbb5-fdd2-4792-99be-c5c62490ba23">

`만들기 메뉴에서 위 사진과 같이 리소스 그룹, 인스턴스 정보 게시 등 별표가 있는 필수요소를 입력해줍니다.`
<img width="799" alt="스크린샷 2024-08-27 오전 12 40 57" src="https://github.com/user-attachments/assets/40491b82-efaf-44ba-a212-025adef90a70">
`다음으로 태그 를 입력해줍니다.`
<img width="466" alt="스크린샷 2024-08-27 오전 12 41 16" src="https://github.com/user-attachments/assets/b0871440-5736-4f68-b890-a3ff5b7f1112">

`마지막으로 검토 후 만들기를 누릅니다.`
<img width="411" alt="스크린샷 2024-08-27 오전 12 41 31" src="https://github.com/user-attachments/assets/e9a9b3d4-ea2c-4f4a-89af-58ffe385ccd9">

`생성이 될때 까지 잠시 기다린 후 Go to resource를 눌러줍니다. (리소스 보러 가기)`

<img width="673" alt="스크린샷 2024-08-27 오전 12 41 41" src="https://github.com/user-attachments/assets/5d695642-f69f-43a8-a2d7-60d913b17179">

`다음으로 VSCode를 열어주고 위의 3가지 익스텐션을 설치 해줍니다.`

<img width="338" alt="스크린샷 2024-08-27 오전 12 41 49" src="https://github.com/user-attachments/assets/42be9130-0c8c-4868-9094-594fe27afb6f">

`설치 후 Azure Icon을 눌러서 Sign in to Azure를 눌러줍니다.`

<img width="244" alt="스크린샷 2024-08-27 오전 12 42 09" src="https://github.com/user-attachments/assets/a4633d80-c26a-48e1-b875-bbccc2257562">

`Azure에 로그인 후 AppService Icon을 눌러 주고 배포할 AppService를 오른쪽 클릭해 Deploy to WEB App을 클릭해 줍니다.`
<img width="496" alt="스크린샷 2024-08-27 오전 12 42 16" src="https://github.com/user-attachments/assets/a2014fbe-35b9-4cc2-8567-a95985c0af14">

`다음으로 Browser로 클릭해주고 "빌드한" 리액트 프로젝트의 "build 폴더" 를 클릭해줍니다.`

<img width="291" alt="스크린샷 2024-08-27 오전 12 42 56" src="https://github.com/user-attachments/assets/fd52d258-7520-40be-b09e-06b6c8c5e40b">

`그 후 Deploy와 Browse Website를 눌러 배포 상태를 확인합니다.`

<img width="1782" alt="스크린샷 2024-08-27 오전 7 13 26" src="https://github.com/user-attachments/assets/84a133f0-a834-4a5f-9589-9f523beec95a">

`다음과 같이 배포가 잘 된 모습을 볼 수 있습니다.`
Empty file added ai_publish_profile.xml
Empty file.
66 changes: 0 additions & 66 deletions infra/appservice.bicep

This file was deleted.

9 changes: 0 additions & 9 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ module db './db.bicep' = {
}
}

module appservice './appservice.bicep' = {
name: 'appservice'
scope: resourceGroup()
params: {
appName: name
location: location
}
}

module aiservice './aiservice.bicep' = {
name: 'aiservice'
scope: resourceGroup()
Expand Down

0 comments on commit f3a3f5c

Please sign in to comment.