From c0c059baa335ec4223e8236ba11d1912e992d9ca Mon Sep 17 00:00:00 2001 From: NK-DPM <117199064+NK-DPM@users.noreply.github.com> Date: Fri, 27 Jan 2023 15:41:05 +0700 Subject: [PATCH 1/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/tomcat_starttest.yml | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/tomcat_starttest.yml diff --git a/.github/workflows/tomcat_starttest.yml b/.github/workflows/tomcat_starttest.yml new file mode 100644 index 000000000..a5ba971b1 --- /dev/null +++ b/.github/workflows/tomcat_starttest.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 WAR app to Azure Web App - starttest + +on: + push: + branches: + - tomcat + 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/*.war' + + 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: 'starttest' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_CE17C72219F54DB8916AC679DBEC57FC }} + package: '*.war' From efafd129ff0edd571a6de1a30a46c254b4402a52 Mon Sep 17 00:00:00 2001 From: NK-DPM <117199064+NK-DPM@users.noreply.github.com> Date: Fri, 27 Jan 2023 15:49:40 +0700 Subject: [PATCH 2/4] Hello Azure --- 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 1c5eba242..3cb21be6d 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -16,6 +16,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello World!"; + return "Hello Azure!"; } } From 10fdfe0a1932446f6bf61cb9064f8fbeec91b35c Mon Sep 17 00:00:00 2001 From: NK-DPM <117199064+NK-DPM@users.noreply.github.com> Date: Fri, 27 Jan 2023 15:56:04 +0700 Subject: [PATCH 3/4] Azure02 --- 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 3cb21be6d..e95c07c23 100644 --- a/src/main/java/com/example/demo/DemoApplication.java +++ b/src/main/java/com/example/demo/DemoApplication.java @@ -16,6 +16,6 @@ public static void main(String[] args) { @RequestMapping("/") String sayHello() { - return "Hello Azure!"; + return "Hello Azure !!"; } } From ef86b6e85d5712b9a81f6b09d3dad23b041428c7 Mon Sep 17 00:00:00 2001 From: NK-DPM <117199064+NK-DPM@users.noreply.github.com> Date: Wed, 15 Feb 2023 12:22:02 +0700 Subject: [PATCH 4/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/tomcat_dpmtestlinux.yml | 53 +++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/tomcat_dpmtestlinux.yml diff --git a/.github/workflows/tomcat_dpmtestlinux.yml b/.github/workflows/tomcat_dpmtestlinux.yml new file mode 100644 index 000000000..691fa19d3 --- /dev/null +++ b/.github/workflows/tomcat_dpmtestlinux.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 WAR app to Azure Web App - dpmtestlinux + +on: + push: + branches: + - tomcat + 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/*.war' + + 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: 'dpmtestlinux' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8196703FC9894A49B92493D294258383 }} + package: '*.war'