From 9c97d801ca8f97bacf73cff1b529713d885315c5 Mon Sep 17 00:00:00 2001 From: Ss-ss-03 <84327899+Ss-ss-03@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:04:46 +0530 Subject: [PATCH 1/2] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_appsweb1.yml | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/master_appsweb1.yml diff --git a/.github/workflows/master_appsweb1.yml b/.github/workflows/master_appsweb1.yml new file mode 100644 index 0000000..460c267 --- /dev/null +++ b/.github/workflows/master_appsweb1.yml @@ -0,0 +1,63 @@ +# 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 - appsweb1 + +on: + push: + branches: + - master + 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: 'java21' + 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 + + 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_485CBD417D8B4A8C9C16150DFBB13C73 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_A3F61E05B21B44D288177EF5650727CC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_C80FB95447EE4146B08067974300ABE0 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'appsweb1' + slot-name: 'Production' + package: '*.jar' + \ No newline at end of file From 50c8f74feaa5d1ce8e7f54eb638d187f6becf302 Mon Sep 17 00:00:00 2001 From: Ss-ss-03 <84327899+Ss-ss-03@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:18:11 +0530 Subject: [PATCH 2/2] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_webapppp.yml | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/master_webapppp.yml diff --git a/.github/workflows/master_webapppp.yml b/.github/workflows/master_webapppp.yml new file mode 100644 index 0000000..7218bb3 --- /dev/null +++ b/.github/workflows/master_webapppp.yml @@ -0,0 +1,63 @@ +# 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 - webapppp + +on: + push: + branches: + - master + 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: '8' + 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 + + 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_8A49866FE0F1469BB955BA24EDBBF9B9 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7520C0C73B42445E963E162D5F2E4F67 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_EBDF6E0D5BCA482892516951A39BD1D7 }} + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'webapppp' + slot-name: 'Production' + package: '*.jar' + \ No newline at end of file