This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
Update main_onna.yml #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy JAR app to Azure Web App - onna | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 리포지토리의 코드를 체크아웃합니다. | |
- uses: actions/checkout@v4 | |
# Java 17 버전을 설치하고 설정합니다. | |
- name: Set up Java version | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'microsoft' | |
# Gradle을 사용하여 onna-server 디렉토리에서 빌드를 수행합니다. | |
- name: Build with Gradle | |
run: | | |
cd onna-server | |
./gradlew build | |
continue-on-error: true | |
# 빌드된 JAR 파일을 업로드하여 다음 배포 단계에서 사용할 수 있도록 합니다. | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v4 | |
with: | |
name: java-app | |
path: 'onna-server/build/libs/*.jar' | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
# 빌드 단계에서 업로드한 아티팩트를 다운로드합니다. | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v4 | |
with: | |
name: java-app | |
# Azure Web App에 JAR 파일을 배포합니다. | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: 'onna' | |
slot-name: 'Production' | |
package: 'onna-server/build/libs/*.jar' | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D04B2FA0C49A43908FE2C03A2EE374BD }} |