From 32ad003c6f76fc4aebf93035fe72f70f1c1359dc Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 00:12:07 +0300 Subject: [PATCH 01/16] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_todo-python-api.yml | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/main_todo-python-api.yml diff --git a/.github/workflows/main_todo-python-api.yml b/.github/workflows/main_todo-python-api.yml new file mode 100644 index 0000000..359d59b --- /dev/null +++ b/.github/workflows/main_todo-python-api.yml @@ -0,0 +1,79 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions +# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions + +name: Build and deploy Python app to Azure Web App - todo-python-api + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Create and start virtual environment + run: | + python -m venv venv + source venv/bin/activate + + - name: Install dependencies + run: pip install -r requirements.txt + + # Optional: Add step to run tests here (PyTest, Django test suites, etc.) + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment jobs + uses: actions/upload-artifact@v4 + with: + name: python-app + path: | + release.zip + !venv/ + + deploy: + runs-on: ubuntu-latest + needs: build + + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: python-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5BF9C6F332B048678FDDF03501410E3D }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'todo-python-api' + slot-name: 'Production' + \ No newline at end of file From 159d23a2fd840375d14f765bcc2badda287ea2f7 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 00:21:42 +0300 Subject: [PATCH 02/16] Update main_todo-python-api.yml --- .github/workflows/main_todo-python-api.yml | 40 +++++++++------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main_todo-python-api.yml b/.github/workflows/main_todo-python-api.yml index 359d59b..4c4d58e 100644 --- a/.github/workflows/main_todo-python-api.yml +++ b/.github/workflows/main_todo-python-api.yml @@ -1,7 +1,3 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions -# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions - name: Build and deploy Python app to Azure Web App - todo-python-api on: @@ -14,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest permissions: - contents: read #This is required for actions/checkout + contents: read steps: - uses: actions/checkout@v4 @@ -28,30 +24,30 @@ jobs: run: | python -m venv venv source venv/bin/activate - + working-directory: src/api + - name: Install dependencies run: pip install -r requirements.txt - - # Optional: Add step to run tests here (PyTest, Django test suites, etc.) + working-directory: src/api + + # Optional: Add step to run tests here - name: Zip artifact for deployment run: zip release.zip ./* -r + working-directory: src/api - name: Upload artifact for deployment jobs uses: actions/upload-artifact@v4 with: name: python-app - path: | - release.zip - !venv/ + path: src/api/release.zip deploy: runs-on: ubuntu-latest needs: build - - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout + permissions: + id-token: write + contents: read steps: - name: Download artifact from build job @@ -62,13 +58,12 @@ jobs: - name: Unzip artifact for deployment run: unzip release.zip - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5BF9C6F332B048678FDDF03501410E3D }} + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5BF9C6F332B048678FDDF03501410E3D }} - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v3 @@ -76,4 +71,3 @@ jobs: with: app-name: 'todo-python-api' slot-name: 'Production' - \ No newline at end of file From 2a6e1ffc46e87232e87d1cb261d36704b5778256 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 00:46:05 +0300 Subject: [PATCH 03/16] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_todo-react-web.yml | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/main_todo-react-web.yml diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml new file mode 100644 index 0000000..fe52139 --- /dev/null +++ b/.github/workflows/main_todo-react-web.yml @@ -0,0 +1,72 @@ +# 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 - todo-react-web + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js version + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: node-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: node-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_C1B4D351BDB74A61AD5E0797197A525B }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_0CDBF267B2F642B9B6D6143AE30BFCA5 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F944686F48544FC38BF3CF689052F45F }} + + - name: 'Deploy to Azure Web App' + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'todo-react-web' + slot-name: 'Production' + package: . + \ No newline at end of file From c42ee90d1cdaf5bb1d0a70fb833564e6d28d879c Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 00:51:15 +0300 Subject: [PATCH 04/16] Remove the Azure App Service build and deployment workflow config --- .github/workflows/main_todo-react-web.yml | 72 ----------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/main_todo-react-web.yml diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml deleted file mode 100644 index fe52139..0000000 --- a/.github/workflows/main_todo-react-web.yml +++ /dev/null @@ -1,72 +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 Node.js app to Azure Web App - todo-react-web - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read #This is required for actions/checkout - - steps: - - uses: actions/checkout@v4 - - - name: Set up Node.js version - uses: actions/setup-node@v3 - with: - node-version: '20.x' - - - name: npm install, build, and test - run: | - npm install - npm run build --if-present - npm run test --if-present - - - name: Zip artifact for deployment - run: zip release.zip ./* -r - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: node-app - path: release.zip - - deploy: - runs-on: ubuntu-latest - needs: build - - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 - with: - name: node-app - - - name: Unzip artifact for deployment - run: unzip release.zip - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_C1B4D351BDB74A61AD5E0797197A525B }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_0CDBF267B2F642B9B6D6143AE30BFCA5 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_F944686F48544FC38BF3CF689052F45F }} - - - name: 'Deploy to Azure Web App' - id: deploy-to-webapp - uses: azure/webapps-deploy@v3 - with: - app-name: 'todo-react-web' - slot-name: 'Production' - package: . - \ No newline at end of file From 89d56786df39c8ba057fbb9deae0584803b36acf Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:00:11 +0300 Subject: [PATCH 05/16] Create main_todo-react-web.yml --- .github/workflows/main_todo-react-web.yml | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/main_todo-react-web.yml diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml new file mode 100644 index 0000000..c697535 --- /dev/null +++ b/.github/workflows/main_todo-react-web.yml @@ -0,0 +1,61 @@ +name: Build and deploy React app to Azure Web App - todo-react-web + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Install dependencies + run: npm install + working-directory: src/web + + - name: Build + run: npm run build + working-directory: src/web + + - name: Zip build folder + run: zip -r build.zip build + working-directory: src/web + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: node-app + path: src/web/build.zip + + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: node-app + + - name: Unzip artifact for deployment + run: unzip build.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5BF9C6F332B048678FDDF03501410E3D }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + with: + app-name: 'todo-react-web' + slot-name: 'Production' + package: build From 3e87b0a927cb803ff2616b4fdd2f9b9a4436c686 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:02:31 +0300 Subject: [PATCH 06/16] Update main_todo-react-web.yml --- .github/workflows/main_todo-react-web.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml index c697535..d2d6c21 100644 --- a/.github/workflows/main_todo-react-web.yml +++ b/.github/workflows/main_todo-react-web.yml @@ -28,6 +28,13 @@ jobs: run: npm run build working-directory: src/web + - name: Check build folder exists + run: | + if [ ! -d "src/web/build" ]; then + echo "Build folder not found! Build step failed." + exit 1 + fi + - name: Zip build folder run: zip -r build.zip build working-directory: src/web From d4179ca6a4ebfaabfcdbc4eac740f225ec51b81f Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:07:43 +0300 Subject: [PATCH 07/16] Update main_todo-react-web.yml --- .github/workflows/main_todo-react-web.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml index d2d6c21..e658f2c 100644 --- a/.github/workflows/main_todo-react-web.yml +++ b/.github/workflows/main_todo-react-web.yml @@ -28,22 +28,22 @@ jobs: run: npm run build working-directory: src/web - - name: Check build folder exists + - name: Check dist folder exists run: | - if [ ! -d "src/web/build" ]; then - echo "Build folder not found! Build step failed." + if [ ! -d "src/web/dist" ]; then + echo "Dist folder not found! Build step failed." exit 1 fi - - name: Zip build folder - run: zip -r build.zip build + - name: Zip dist folder + run: zip -r dist.zip dist working-directory: src/web - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 with: name: node-app - path: src/web/build.zip + path: src/web/dist.zip - name: Download artifact from build job uses: actions/download-artifact@v4 @@ -51,7 +51,7 @@ jobs: name: node-app - name: Unzip artifact for deployment - run: unzip build.zip + run: unzip dist.zip - name: Login to Azure uses: azure/login@v2 @@ -65,4 +65,4 @@ jobs: with: app-name: 'todo-react-web' slot-name: 'Production' - package: build + package: dist From 59d76005021079eade0a9c71588f55fde7d15ac2 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:09:43 +0300 Subject: [PATCH 08/16] Update main_todo-react-web.yml --- .github/workflows/main_todo-react-web.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml index e658f2c..27cc150 100644 --- a/.github/workflows/main_todo-react-web.yml +++ b/.github/workflows/main_todo-react-web.yml @@ -11,6 +11,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + id-token: write steps: - uses: actions/checkout@v4 From 65812ea8d42b8f4a9f6fa138bc48d96218aaf788 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:15:23 +0300 Subject: [PATCH 09/16] Update main_todo-react-web.yml From a2b89f4464b9a8a6b9468d86eb328b9fcd2b2dd8 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:22:00 +0300 Subject: [PATCH 10/16] Update main_todo-react-web.yml --- .github/workflows/main_todo-react-web.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml index 27cc150..b120dba 100644 --- a/.github/workflows/main_todo-react-web.yml +++ b/.github/workflows/main_todo-react-web.yml @@ -59,7 +59,7 @@ jobs: with: client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5BF9C6F332B048678FDDF03501410E3D }} + subscription-id: 8abd0445-b3d6-4d34-a163-810585813e7e - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v3 From 070a3357deb9af0058a6cd2dd4bd23d774ad2c23 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:47:11 +0300 Subject: [PATCH 11/16] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_todo-react-web.yml | 133 +++++++++++----------- 1 file changed, 68 insertions(+), 65 deletions(-) diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml index b120dba..14299b7 100644 --- a/.github/workflows/main_todo-react-web.yml +++ b/.github/workflows/main_todo-react-web.yml @@ -1,69 +1,72 @@ -name: Build and deploy React app to Azure Web App - todo-react-web - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build-and-deploy: - runs-on: ubuntu-latest +# 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 - todo-react-web + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js version + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: node-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: - contents: read - id-token: write - - steps: - - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' - - - name: Install dependencies - run: npm install - working-directory: src/web - - - name: Build - run: npm run build - working-directory: src/web - - - name: Check dist folder exists - run: | - if [ ! -d "src/web/dist" ]; then - echo "Dist folder not found! Build step failed." - exit 1 - fi - - - name: Zip dist folder - run: zip -r dist.zip dist - working-directory: src/web - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: node-app - path: src/web/dist.zip - - - name: Download artifact from build job - uses: actions/download-artifact@v4 - with: - name: node-app - - - name: Unzip artifact for deployment - run: unzip dist.zip - + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: node-app + + - name: Unzip artifact for deployment + run: unzip release.zip + - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }} - subscription-id: 8abd0445-b3d6-4d34-a163-810585813e7e - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v3 - with: - app-name: 'todo-react-web' - slot-name: 'Production' - package: dist + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_3C61EA68193B4750BBCC9EF55BE73187 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6FEE74CC1060419EB3D5E3497954CFEC }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3BD2D4B86A9A4F928DDE2D200971CEB0 }} + + - name: 'Deploy to Azure Web App' + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'todo-react-web' + slot-name: 'Production' + package: . + \ No newline at end of file From 6f56baca1578fe9c91a4696111735a26e961f591 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:48:50 +0300 Subject: [PATCH 12/16] Remove the Azure App Service build and deployment workflow config --- .github/workflows/main_todo-react-web.yml | 72 ----------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/main_todo-react-web.yml diff --git a/.github/workflows/main_todo-react-web.yml b/.github/workflows/main_todo-react-web.yml deleted file mode 100644 index 14299b7..0000000 --- a/.github/workflows/main_todo-react-web.yml +++ /dev/null @@ -1,72 +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 Node.js app to Azure Web App - todo-react-web - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read #This is required for actions/checkout - - steps: - - uses: actions/checkout@v4 - - - name: Set up Node.js version - uses: actions/setup-node@v3 - with: - node-version: '20.x' - - - name: npm install, build, and test - run: | - npm install - npm run build --if-present - npm run test --if-present - - - name: Zip artifact for deployment - run: zip release.zip ./* -r - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: node-app - path: release.zip - - deploy: - runs-on: ubuntu-latest - needs: build - - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 - with: - name: node-app - - - name: Unzip artifact for deployment - run: unzip release.zip - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_3C61EA68193B4750BBCC9EF55BE73187 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6FEE74CC1060419EB3D5E3497954CFEC }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3BD2D4B86A9A4F928DDE2D200971CEB0 }} - - - name: 'Deploy to Azure Web App' - id: deploy-to-webapp - uses: azure/webapps-deploy@v3 - with: - app-name: 'todo-react-web' - slot-name: 'Production' - package: . - \ No newline at end of file From b039d5ea16254645f4bdf74018729b26c2a7775d Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 01:51:32 +0300 Subject: [PATCH 13/16] Create main_todo-react-web.yaml --- .github/workflows/main_todo-react-web.yaml | 69 ++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/main_todo-react-web.yaml diff --git a/.github/workflows/main_todo-react-web.yaml b/.github/workflows/main_todo-react-web.yaml new file mode 100644 index 0000000..ca1ce45 --- /dev/null +++ b/.github/workflows/main_todo-react-web.yaml @@ -0,0 +1,69 @@ +name: Build and deploy React app to Azure Web App - todo-react-web + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: Install dependencies + run: npm install + working-directory: src/web + + - name: Build + run: npm run build + working-directory: src/web + + - name: Check dist folder exists + run: | + if [ ! -d "src/web/dist" ]; then + echo "Dist folder not found! Build step failed." + exit 1 + fi + + - name: Zip dist folder + run: zip -r dist.zip dist + working-directory: src/web + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: node-app + path: src/web/dist.zip + + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: node-app + + - name: Unzip artifact for deployment + run: unzip dist.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_ece2a6d0-196f-4c93-8e47-500e4840b982 }} + subscription-id: 8abd0445-b3d6-4d34-a163-810585813e7e + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + with: + app-name: 'todo-react-web' + slot-name: 'Production' + package: dist From 0c6696b8f80a587b788242c065491d58e7402f90 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 14:09:32 +0300 Subject: [PATCH 14/16] Update main_todo-react-web.yaml --- .github/workflows/main_todo-react-web.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_todo-react-web.yaml b/.github/workflows/main_todo-react-web.yaml index ca1ce45..d79d551 100644 --- a/.github/workflows/main_todo-react-web.yaml +++ b/.github/workflows/main_todo-react-web.yaml @@ -57,13 +57,11 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_ece2a6d0-196f-4c93-8e47-500e4840b982 }} - subscription-id: 8abd0445-b3d6-4d34-a163-810585813e7e - + creds: ${{ secrets.LASTTODOAPP }} - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v3 with: app-name: 'todo-react-web' slot-name: 'Production' package: dist + From 04778b5749e636fb1d338a1885fbda792862767d Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 14:18:04 +0300 Subject: [PATCH 15/16] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/test_todo-react-web.yml | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/test_todo-react-web.yml diff --git a/.github/workflows/test_todo-react-web.yml b/.github/workflows/test_todo-react-web.yml new file mode 100644 index 0000000..973ab2f --- /dev/null +++ b/.github/workflows/test_todo-react-web.yml @@ -0,0 +1,72 @@ +# 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 - todo-react-web + +on: + push: + branches: + - test + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read #This is required for actions/checkout + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js version + uses: actions/setup-node@v3 + with: + node-version: '20.x' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: Zip artifact for deployment + run: zip release.zip ./* -r + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v4 + with: + name: node-app + path: release.zip + + deploy: + runs-on: ubuntu-latest + needs: build + + permissions: + id-token: write #This is required for requesting the JWT + contents: read #This is required for actions/checkout + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v4 + with: + name: node-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_FC1B165A13CB43BE8C9805F08F73FEA0 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D3E10ECC30ED4375876CE89A8A4D8BF2 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_25E8145D378D4699A8151A8094F07A4A }} + + - name: 'Deploy to Azure Web App' + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'todo-react-web' + slot-name: 'Production' + package: . + \ No newline at end of file From 54b7fe26e0b7ce5b8367a07272aee347303223b0 Mon Sep 17 00:00:00 2001 From: dlrmnts <71024884+dlrmnts@users.noreply.github.com> Date: Wed, 9 Jul 2025 14:38:35 +0300 Subject: [PATCH 16/16] Remove the Azure App Service build and deployment workflow config --- .github/workflows/test_todo-react-web.yml | 72 ----------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/test_todo-react-web.yml diff --git a/.github/workflows/test_todo-react-web.yml b/.github/workflows/test_todo-react-web.yml deleted file mode 100644 index 973ab2f..0000000 --- a/.github/workflows/test_todo-react-web.yml +++ /dev/null @@ -1,72 +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 Node.js app to Azure Web App - todo-react-web - -on: - push: - branches: - - test - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read #This is required for actions/checkout - - steps: - - uses: actions/checkout@v4 - - - name: Set up Node.js version - uses: actions/setup-node@v3 - with: - node-version: '20.x' - - - name: npm install, build, and test - run: | - npm install - npm run build --if-present - npm run test --if-present - - - name: Zip artifact for deployment - run: zip release.zip ./* -r - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: node-app - path: release.zip - - deploy: - runs-on: ubuntu-latest - needs: build - - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 - with: - name: node-app - - - name: Unzip artifact for deployment - run: unzip release.zip - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_FC1B165A13CB43BE8C9805F08F73FEA0 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D3E10ECC30ED4375876CE89A8A4D8BF2 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_25E8145D378D4699A8151A8094F07A4A }} - - - name: 'Deploy to Azure Web App' - id: deploy-to-webapp - uses: azure/webapps-deploy@v3 - with: - app-name: 'todo-react-web' - slot-name: 'Production' - package: . - \ No newline at end of file