From f877831c6b62b9d1ee031437503fb73b0fc0e43a Mon Sep 17 00:00:00 2001 From: suresh342 <85727838+suresh342@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:42:26 +0530 Subject: [PATCH 1/5] Update GithubCicdActionsApplication.java --- .../java/com/javatechie/cicd/GithubCicdActionsApplication.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/javatechie/cicd/GithubCicdActionsApplication.java b/src/main/java/com/javatechie/cicd/GithubCicdActionsApplication.java index 71e908b..d7ec443 100644 --- a/src/main/java/com/javatechie/cicd/GithubCicdActionsApplication.java +++ b/src/main/java/com/javatechie/cicd/GithubCicdActionsApplication.java @@ -11,7 +11,7 @@ public class GithubCicdActionsApplication { @GetMapping("/welcome") public String welcome(){ - return "Welcome to javatechie !"; + return "Welcome Suresh !"; } // echo "# github-actions-example" >> README.md From b0c16aa3f170b4eb517d4335e354ccb69829c98d Mon Sep 17 00:00:00 2001 From: suresh342 <85727838+suresh342@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:49:04 +0530 Subject: [PATCH 2/5] Update maven.yml --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 82af4a9..9875031 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,9 +28,9 @@ jobs: - name: Build & push Docker image uses: mr-smithers-excellent/docker-build-push@v5 with: - image: javatechie/springboot-images-new + image: mydockersureshvelpula/javaspring-app-github-actions tags: latest registry: docker.io dockerfile: Dockerfile username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file + password: ${{ secrets.DOCKER_PASSWORD }} From 81b26763be52b362e6372b2cd53004ae871a0ebe Mon Sep 17 00:00:00 2001 From: suresh342 <85727838+suresh342@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:58:05 +0530 Subject: [PATCH 3/5] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f7cd959..6c20c4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM openjdk:8 -EXPOSE 8080 +EXPOSE 8081 ADD target/springboot-images-new.jar springboot-images-new.jar -ENTRYPOINT ["java","-jar","/springboot-images-new.jar"] \ No newline at end of file +ENTRYPOINT ["java","-jar","/springboot-images-new.jar"] From 8989e7d10bd6744b0def0c1649808d89261678b8 Mon Sep 17 00:00:00 2001 From: suresh342 <85727838+suresh342@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:26:44 +0530 Subject: [PATCH 4/5] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_mywebappdar.yml | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/master_mywebappdar.yml diff --git a/.github/workflows/master_mywebappdar.yml b/.github/workflows/master_mywebappdar.yml new file mode 100644 index 0000000..036d2d0 --- /dev/null +++ b/.github/workflows/master_mywebappdar.yml @@ -0,0 +1,56 @@ +# 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 Node.js app to Azure Web App - mywebappdar + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Node.js version + uses: actions/setup-node@v1 + with: + node-version: '18.x' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: node-app + path: . + + 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: node-app + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + id: deploy-to-webapp + with: + app-name: 'mywebappdar' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_60DA1E8724F7436BB0407FBA8C825669 }} + package: . From 5ddf7536799ec5a66f2234365708b01ba00a474e Mon Sep 17 00:00:00 2001 From: suresh342 <85727838+suresh342@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:31:19 +0530 Subject: [PATCH 5/5] Update master_mywebappdar.yml --- .github/workflows/master_mywebappdar.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master_mywebappdar.yml b/.github/workflows/master_mywebappdar.yml index 036d2d0..29115ed 100644 --- a/.github/workflows/master_mywebappdar.yml +++ b/.github/workflows/master_mywebappdar.yml @@ -24,8 +24,8 @@ jobs: - name: npm install, build, and test run: | npm install - npm run build --if-present - npm run test --if-present + npm run build + npm run test - name: Upload artifact for deployment job uses: actions/upload-artifact@v2