From 7f7d685b864abc8e54cd975ab28e57aab6af31a8 Mon Sep 17 00:00:00 2001 From: Malavika090 <121013662+Malavika090@users.noreply.github.com> Date: Mon, 26 Dec 2022 12:38:54 +0530 Subject: [PATCH 1/6] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_javahelloworld.yml | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/main_javahelloworld.yml diff --git a/.github/workflows/main_javahelloworld.yml b/.github/workflows/main_javahelloworld.yml new file mode 100644 index 000000000..d5e8fefe4 --- /dev/null +++ b/.github/workflows/main_javahelloworld.yml @@ -0,0 +1,53 @@ +# 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 - JavaHelloWorld + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Java version + uses: actions/setup-java@v1 + with: + java-version: '11' + + - name: Build with Maven + run: mvn clean install + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + 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 }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: java-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'JavaHelloWorld' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_9652300E819B4B0895750F5FD5B8F242 }} + package: '*.jar' From 9287cc42f569ce8707cc939584994a45db542826 Mon Sep 17 00:00:00 2001 From: Malavika090 Date: Mon, 26 Dec 2022 12:46:27 +0530 Subject: [PATCH 2/6] updated message --- src/main/java/com/example/demo/DemoApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index f594b5bc3..2cbda9cf3 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -15,6 +15,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello World!"; + return "Hello Azure!"; } } From 0add30384f2cdcb994cf2bf6f46c993dc6600b04 Mon Sep 17 00:00:00 2001 From: Malavika090 Date: Mon, 26 Dec 2022 12:58:45 +0530 Subject: [PATCH 3/6] new message addes --- src/main/java/com/example/demo/DemoApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 2cbda9cf3..9f77ee725 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -15,6 +15,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello Azure!"; + return "Hello Malavika.Done with the sample handson!"; } } From c576d032f9a1ff678c1b8d0cb9e1b165dfa14cbd Mon Sep 17 00:00:00 2001 From: Malavika090 <121013662+Malavika090@users.noreply.github.com> Date: Tue, 27 Dec 2022 13:28:03 +0530 Subject: [PATCH 4/6] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_helloworldjava12.yml | 53 +++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/main_helloworldjava12.yml diff --git a/.github/workflows/main_helloworldjava12.yml b/.github/workflows/main_helloworldjava12.yml new file mode 100644 index 000000000..1ecbcad7d --- /dev/null +++ b/.github/workflows/main_helloworldjava12.yml @@ -0,0 +1,53 @@ +# 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 - HelloWorldJava12 + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Java version + uses: actions/setup-java@v1 + with: + java-version: '11' + + - name: Build with Maven + run: mvn clean install + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + 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 }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: java-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'HelloWorldJava12' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_00B2A966DE3A4FBC82A5F8456F9BDCCA }} + package: '*.jar' From aeee0724b41379d546c728fb5814bb8dd691d2bd Mon Sep 17 00:00:00 2001 From: Malavika090 Date: Tue, 27 Dec 2022 13:33:31 +0530 Subject: [PATCH 5/6] Updated Message --- src/main/java/com/example/demo/DemoApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/example/demo/DemoApplication.java b/src/main/java/com/example/demo/DemoApplication.java index 9f77ee725..2cbda9cf3 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -15,6 +15,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello Malavika.Done with the sample handson!"; + return "Hello Azure!"; } } From 48dd54844287e0d1f9cbd623b05abe89eb46cf16 Mon Sep 17 00:00:00 2001 From: Malavika090 <121013662+Malavika090@users.noreply.github.com> Date: Tue, 27 Dec 2022 13:38:42 +0530 Subject: [PATCH 6/6] Delete main_javahelloworld.yml --- .github/workflows/main_javahelloworld.yml | 53 ----------------------- 1 file changed, 53 deletions(-) delete mode 100644 .github/workflows/main_javahelloworld.yml diff --git a/.github/workflows/main_javahelloworld.yml b/.github/workflows/main_javahelloworld.yml deleted file mode 100644 index d5e8fefe4..000000000 --- a/.github/workflows/main_javahelloworld.yml +++ /dev/null @@ -1,53 +0,0 @@ -# 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 - JavaHelloWorld - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Java version - uses: actions/setup-java@v1 - with: - java-version: '11' - - - name: Build with Maven - run: mvn clean install - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v2 - 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 }} - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v2 - with: - name: java-app - - - name: Deploy to Azure Web App - id: deploy-to-webapp - uses: azure/webapps-deploy@v2 - with: - app-name: 'JavaHelloWorld' - slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_9652300E819B4B0895750F5FD5B8F242 }} - package: '*.jar'