- GitHub Account
- GitHub CLI
- Azure CLI
- Azure Account
- Azure Resource Group
- 이 리포지토리를 포크하고 다음 명령어로 클론합니다.
git clone https://github.com/{{내 깃헙 아이디}}/Na-a.git
cd Get-It
- 다음과 같이 인프라를 배포합니다
az login
az deployment group create --resource-group {{내 리소스 그룹}} --template-file ./infra/main.bicep --parameters name=icare
- 다음과 같이 github workflow 시크릿을 설정합니다. (윈도우 기준)
az webapp deployment list-publishing-profiles --name "icare-app-heckers" --resource-group $AZURE_RESOURCE_GROUP --xml > publish_profile.xml
gh auth login
gh secret set AZURE_APP_NAME --repo $GITHUB_USERNAME/Get-It --body "$AZURE_ENV_NAME"
cat publish_profile.xml | gh secret set AZURE_WEBAPP_PUBLISH_PROFILE --repo $GITHUB_USERNAME/Get-It
- 포크한 리포지토리의 Github Actions를 활성화 해줍니다.
https://github.com/{{자신의 Github ID}}/Get-It/actions
에 접속해 초록색 Enable 버튼 클릭
- 다음과 같이 github actions workflow를 실행합니다. (윈도우 기준)
gh workflow run "Azure Deployment" --repo $GITHUB_USERNAME/Get-It
- 배포가 완료될때까지 기다립니다. (10분 가량 소요됩니다.)
- 다음과 같이 백엔드 배포를 확인합니다.
iwr https://$AZURE_ENV_NAME-app.azurewebsites.net/api/charger
- 이 리포지토리에 있는 Frontend Branch를 clone 합니다
git clone --branch Frontend https://github.com/hackersground-kr/Get-It.git
- 다음과 링크에 접속해서 Node js LTS 버전을 설치해줍니다 (Node js 18.x 이여야합니다)
https://nodejs.org/en
- 자동적으로 환경변수 세팅이 되지만 터미널에 node -v 를 입력하여 설치가 제대로 되었는지 확인합니다
node -v
- 터미널에서 clone한 repository로 이동하여 node package manager를 사용해 라이브러리를 설치해줍니다
cd Get-It
npm i
- 패키지 설치가 완료될때까지 기다립니다. (10분 가량 소요됩니다.)
- 설치가 완료되면 expo를 실행시켜 배포를 활성화 합니다
npx expo start
- 배포가 완료된 상황에서 android 가상머신을 실행후에 'a'를 입력하면 배포 및 실행이 진행됩니다
- 'i'를 입력하면 ios 가상머신으로 실행됩니다.
- Physical Device로 실행 하기 위해서는 같은 네트워크에 연결된 환경에서 스마트폰에 expo 앱을 설치하고 생성된 QR을 찍으면 앱이 배포됩니다.
- 중간에 앱이 멈췄다면 터미널에서 'r'키를 눌러서 reload를 해주면 됩니다