compelted project #1
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 - a-mazing-journey-backend | |
on: | |
push: | |
paths: | |
- 'backend/**' | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Java version | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '17' | |
- name: Build with Maven in backend | |
run: mvn clean install | |
working-directory: backend | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v2 | |
with: | |
name: java-app | |
path: 'backend/target/a-mazing-journey-backend.jar' | |
deploy: | |
runs-on: windows-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@v2 | |
with: | |
name: java-app | |
working-directory: backend | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'a-mazing-journey-backend' | |
slot-name: 'Production' | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_12EF4EE9C6C641EFA72D001B30FB92ED }} | |
package: '*.jar' |