This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
Update TOPIC.md #58
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 | |
- name: Set up Java version | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'microsoft' | |
- name: Build with Gradle | |
working-directory: ./onna-server # Specify the directory where the server files are located | |
run: ./gradlew build | |
- 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 | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: 'onna' | |
slot-name: 'Production' | |
package: '*.jar' # Ensure the downloaded JAR is correctly referenced | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D04B2FA0C49A43908FE2C03A2EE374BD }} |