From d51523db341ef7caa5b0209d18d9605bf8131ed9 Mon Sep 17 00:00:00 2001 From: gorav-git Date: Tue, 28 Jan 2025 14:47:51 -0800 Subject: [PATCH 1/2] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_quarkuwebapp-gorav.yml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/main_quarkuwebapp-gorav.yml diff --git a/.github/workflows/main_quarkuwebapp-gorav.yml b/.github/workflows/main_quarkuwebapp-gorav.yml new file mode 100644 index 0000000..5f7468c --- /dev/null +++ b/.github/workflows/main_quarkuwebapp-gorav.yml @@ -0,0 +1,66 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy JAR app to Azure Web App - quarkuwebapp-gorav + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java version + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'microsoft' + + - name: Build with Maven + run: mvn clean install + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: java-app + path: '${{ github.workspace }}/target/*.jar' + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: java-app + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_423FFDA3927F402BBA98F23E7008DD93 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_097A8AB373334EEFA20BAB07EDD2CA6D }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_87E4B74DDD0349299C40314A5B227CF8 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'quarkuwebapp-gorav' + slot-name: 'Production' + package: '*.jar' + \ No newline at end of file From b3d01e1d2d1fd1f5d31703c0abae96b4d4d196f1 Mon Sep 17 00:00:00 2001 From: gorav-git Date: Tue, 28 Jan 2025 22:53:43 +0000 Subject: [PATCH 2/2] Configure DB and deployment workflow --- .github/workflows/main_quarkuwebapp-gorav.yml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main_quarkuwebapp-gorav.yml b/.github/workflows/main_quarkuwebapp-gorav.yml index 5f7468c..1b119db 100644 --- a/.github/workflows/main_quarkuwebapp-gorav.yml +++ b/.github/workflows/main_quarkuwebapp-gorav.yml @@ -25,7 +25,7 @@ jobs: distribution: 'microsoft' - name: Build with Maven - run: mvn clean install + run: mvn clean install -DskipTests - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 @@ -36,25 +36,25 @@ jobs: deploy: runs-on: ubuntu-latest needs: build - environment: - name: 'Production' + environment: + name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout steps: - name: Download artifact from build job uses: actions/download-artifact@v4 with: name: java-app - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_423FFDA3927F402BBA98F23E7008DD93 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_097A8AB373334EEFA20BAB07EDD2CA6D }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_87E4B74DDD0349299C40314A5B227CF8 }} + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_423FFDA3927F402BBA98F23E7008DD93 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_097A8AB373334EEFA20BAB07EDD2CA6D }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_87E4B74DDD0349299C40314A5B227CF8 }} - name: Deploy to Azure Web App id: deploy-to-webapp