From 4bd7ee3d38096be9173b82bf67ffdafbbdaa7727 Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 15:47:23 +0530 Subject: [PATCH 1/9] Update app.html added text --- src/app/app.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.html b/src/app/app.html index 33a876b..2696c10 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -231,7 +231,7 @@

Hello, {{ title() }}

-

Congratulations! Your app is running successfull.

+

Congratulations! Your app is running successfully.

From 779c0348de355fa1f320ae1260071527d6378bf0 Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 15:57:33 +0530 Subject: [PATCH 2/9] Update login.yaml updated the text --- .github/workflows/login.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/login.yaml b/.github/workflows/login.yaml index 580973d..3a436e3 100644 --- a/.github/workflows/login.yaml +++ b/.github/workflows/login.yaml @@ -7,7 +7,7 @@ on: branches: [main] env: - AZURE_WEBAPP_NAME: testsampleangular + AZURE_WEBAPP_NAME: testsampleangular # Your Azure Web App name NODE_VERSION: '20' jobs: @@ -33,7 +33,7 @@ jobs: # Add a web.config to disable caching for index.html - name: Add no-cache web.config run: | - cat << 'EOF' > dist/login-app/browser/web.config + cat << 'EOF' > dist/login-app/web.config @@ -47,7 +47,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: angular-build - path: dist/login-app/browser/* + path: dist/login-app/* deploy: needs: build-and-test From bb67af28dd413db3db83e3c689bb84364a404cfc Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 16:02:52 +0530 Subject: [PATCH 3/9] Update login.yaml updated deployment method --- .github/workflows/login.yaml | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/login.yaml b/.github/workflows/login.yaml index 3a436e3..74d7ff2 100644 --- a/.github/workflows/login.yaml +++ b/.github/workflows/login.yaml @@ -1,4 +1,4 @@ -name: CI & Deploy Angular App +name: CI & Deploy Angular App (Direct) on: push: @@ -7,12 +7,14 @@ on: branches: [main] env: - AZURE_WEBAPP_NAME: testsampleangular # Your Azure Web App name + AZURE_WEBAPP_NAME: testsampleangular # Azure Web App name NODE_VERSION: '20' jobs: - build-and-test: + build-and-deploy: runs-on: ubuntu-latest + environment: + name: Production steps: - name: Checkout code @@ -30,7 +32,6 @@ jobs: - name: Build Angular app run: npm run build -- --configuration production - # Add a web.config to disable caching for index.html - name: Add no-cache web.config run: | cat << 'EOF' > dist/login-app/web.config @@ -43,33 +44,9 @@ jobs: EOF - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: angular-build - path: dist/login-app/* - - deploy: - needs: build-and-test - runs-on: ubuntu-latest - environment: - name: Production - - steps: - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: angular-build - path: ./build - - - name: Zip build output - run: | - cd build - zip -r ../deploy.zip . - - name: Deploy to Azure Web App uses: azure/webapps-deploy@v2 with: app-name: ${{ env.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: deploy.zip + package: dist/login-app From 399ea58547b493c43e5c6a15c10e19b85123559c Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 16:16:48 +0530 Subject: [PATCH 4/9] Update login.yaml updated output path --- .github/workflows/login.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/login.yaml b/.github/workflows/login.yaml index 74d7ff2..c07a47f 100644 --- a/.github/workflows/login.yaml +++ b/.github/workflows/login.yaml @@ -32,9 +32,10 @@ jobs: - name: Build Angular app run: npm run build -- --configuration production + # Add no-cache web.config to prevent browser from caching index.html - name: Add no-cache web.config run: | - cat << 'EOF' > dist/login-app/web.config + cat << 'EOF' > dist/login-app/browser/web.config @@ -49,4 +50,4 @@ jobs: with: app-name: ${{ env.AZURE_WEBAPP_NAME }} publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: dist/login-app + package: dist/login-app/browser From 960ab185e71022fe1f26774d1ab39b30bfbf19e9 Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 16:42:51 +0530 Subject: [PATCH 5/9] Update login.yaml updated code --- .github/workflows/login.yaml | 37 +++++++++++------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/.github/workflows/login.yaml b/.github/workflows/login.yaml index c07a47f..9c3ee16 100644 --- a/.github/workflows/login.yaml +++ b/.github/workflows/login.yaml @@ -1,20 +1,16 @@ -name: CI & Deploy Angular App (Direct) +name: Build and Test Angular App on: push: - branches: [main] - pull_request: - branches: [main] + branches: + - main env: - AZURE_WEBAPP_NAME: testsampleangular # Azure Web App name NODE_VERSION: '20' jobs: - build-and-deploy: + build-and-test: runs-on: ubuntu-latest - environment: - name: Production steps: - name: Checkout code @@ -29,25 +25,14 @@ jobs: - name: Install dependencies run: npm ci + - name: Run tests + run: npm test -- --watch=false --browsers=ChromeHeadless + - name: Build Angular app run: npm run build -- --configuration production - # Add no-cache web.config to prevent browser from caching index.html - - name: Add no-cache web.config - run: | - cat << 'EOF' > dist/login-app/browser/web.config - - - - - - - - EOF - - - name: Deploy to Azure Web App - uses: azure/webapps-deploy@v2 + - name: Upload build artifact + uses: actions/upload-artifact@v3 with: - app-name: ${{ env.AZURE_WEBAPP_NAME }} - publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: dist/login-app/browser + name: angular-build + path: dist/login-app From 6f09a7d23447e485ecb78ebf203112dd630e0435 Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 16:44:04 +0530 Subject: [PATCH 6/9] Update azure-static-web-apps-black-desert-049c9d11e.yml updated code --- ...static-web-apps-black-desert-049c9d11e.yml | 92 ++++++------------- 1 file changed, 29 insertions(+), 63 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml b/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml index ba3abe5..cf1db91 100644 --- a/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml +++ b/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml @@ -1,63 +1,29 @@ -# name: Azure Static Web Apps CI/CD - -# on: -# push: -# branches: -# - main -# pull_request: -# types: [opened, synchronize, reopened, closed] -# branches: -# - main - -# jobs: -# build_and_deploy_job: -# if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') -# runs-on: ubuntu-latest -# name: Build and Deploy Job -# steps: -# - uses: actions/checkout@v3 -# with: -# submodules: true -# lfs: false - -# - name: Setup Node.js 20.x -# uses: actions/setup-node@v3 -# with: -# node-version: '20' - -# - name: Install Dependencies -# run: npm install - -# - name: Build Application -# run: npm run build - -# # - name: Debug: List build output -# # run: | -# # echo "Contents of dist/login-app:" -# # ls -R dist/login-app - -# - name: Deploy to Azure Static Web Apps -# id: builddeploy -# uses: Azure/static-web-apps-deploy@v1 -# with: -# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_BLACK_DESERT_049C9D11E }} -# repo_token: ${{ secrets.GITHUB_TOKEN }} -# action: "upload" -# app_location: "/" # Your Angular root -# api_location: "" # No API -# output_location: "dist/login-app/browser" # ✅ Correct path for Angular build - -# close_pull_request_job: -# if: github.event_name == 'pull_request' && github.event.action == 'closed' -# runs-on: ubuntu-latest -# name: Close Pull Request Job -# steps: -# - name: Close Pull Request -# id: closepullrequest -# uses: Azure/static-web-apps-deploy@v1 -# with: -# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_BLACK_DESERT_049C9D11E }} -# action: "close" - - - +name: Deploy Angular App to Azure Web App + +on: + workflow_run: + workflows: ["Build and Test Angular App"] + types: + - completed + +env: + AZURE_WEBAPP_NAME: testsampleangular + +jobs: + deploy: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + runs-on: ubuntu-latest + + steps: + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: angular-build + path: dist/login-app + + - name: Deploy to Azure Web App + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: dist/login-app From d4d7b539beb0d6e2a096b5b1910b058ebca76e86 Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 16:45:51 +0530 Subject: [PATCH 7/9] Update app.html add --- src/app/app.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/app.html b/src/app/app.html index 2696c10..33a876b 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -231,7 +231,7 @@

Hello, {{ title() }}

-

Congratulations! Your app is running successfully.

+

Congratulations! Your app is running successfull.

From c6a9260c501f9d5705fa43ad0f94c0c21e188d71 Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 16:47:14 +0530 Subject: [PATCH 8/9] Update login.yaml --- .github/workflows/login.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/login.yaml b/.github/workflows/login.yaml index 9c3ee16..e253e23 100644 --- a/.github/workflows/login.yaml +++ b/.github/workflows/login.yaml @@ -1,4 +1,4 @@ -name: Build and Test Angular App +name: Build and Test Angular Apps on: push: From 3e991e43e45f3598ea18caefbe1adeb4ade91987 Mon Sep 17 00:00:00 2001 From: Pavan1997project Date: Mon, 11 Aug 2025 17:38:23 +0530 Subject: [PATCH 9/9] Update azure-static-web-apps-black-desert-049c9d11e.yml updating code --- ...static-web-apps-black-desert-049c9d11e.yml | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml b/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml index cf1db91..e50105e 100644 --- a/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml +++ b/.github/workflows/azure-static-web-apps-black-desert-049c9d11e.yml @@ -1,25 +1,33 @@ -name: Deploy Angular App to Azure Web App +name: Build and Deploy Angular App to Azure Web App on: - workflow_run: - workflows: ["Build and Test Angular App"] - types: - - completed + push: + branches: + - main env: - AZURE_WEBAPP_NAME: testsampleangular + AZURE_WEBAPP_NAME: testsampleangular + NODE_VERSION: '20' jobs: - deploy: - if: ${{ github.event.workflow_run.conclusion == 'success' }} + build-and-deploy: runs-on: ubuntu-latest steps: - - name: Download build artifact - uses: actions/download-artifact@v3 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 with: - name: angular-build - path: dist/login-app + node-version: ${{ env.NODE_VERSION }} + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build Angular app + run: npm run build -- --configuration production - name: Deploy to Azure Web App uses: azure/webapps-deploy@v2