From bd0bdf56654d69b07b9abae8f60ff08b56feddc0 Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Sat, 14 Dec 2024 17:51:58 +0530 Subject: [PATCH 1/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc216b2..a4e36f9 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -"# SubTracker" +![image](https://github.com/user-attachments/assets/4b9afa60-412f-4547-9d04-ec582ac0fcb3) From 2ce21647e05ba8f2629856cdd1cff233063d4aa8 Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:42:27 +0530 Subject: [PATCH 2/8] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_subtracker.yml | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/main_subtracker.yml diff --git a/.github/workflows/main_subtracker.yml b/.github/workflows/main_subtracker.yml new file mode 100644 index 0000000..1d7e1f7 --- /dev/null +++ b/.github/workflows/main_subtracker.yml @@ -0,0 +1,62 @@ +# 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 - subtracker + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js version + uses: actions/setup-node@v3 + 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: 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 + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + 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: 'Deploy to Azure Web App' + id: deploy-to-webapp + uses: azure/webapps-deploy@v3 + with: + app-name: 'subtracker' + slot-name: 'Production' + package: . + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_31F85007BEBA4D3482D09536C58FE53C }} \ No newline at end of file From 297a7ed7b8f3da3acf485033394938ffcfcf4d9a Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:00:05 +0530 Subject: [PATCH 3/8] Update deployment workflow to use release.zip for package deployment --- .github/workflows/main_subtracker.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main_subtracker.yml b/.github/workflows/main_subtracker.yml index 1d7e1f7..8331ba7 100644 --- a/.github/workflows/main_subtracker.yml +++ b/.github/workflows/main_subtracker.yml @@ -57,6 +57,5 @@ jobs: uses: azure/webapps-deploy@v3 with: app-name: 'subtracker' - slot-name: 'Production' - package: . + package: release.zip publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_31F85007BEBA4D3482D09536C58FE53C }} \ No newline at end of file From 30318eb42d4d3b25c3a7e1d673f61701802b5124 Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:55:07 +0530 Subject: [PATCH 4/8] Remove unzip step for artifact deployment in main_subtracker workflow --- .github/workflows/main_subtracker.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main_subtracker.yml b/.github/workflows/main_subtracker.yml index 8331ba7..cc9cdbb 100644 --- a/.github/workflows/main_subtracker.yml +++ b/.github/workflows/main_subtracker.yml @@ -48,9 +48,6 @@ jobs: uses: actions/download-artifact@v4 with: name: node-app - - - name: Unzip artifact for deployment - run: unzip release.zip - name: 'Deploy to Azure Web App' id: deploy-to-webapp From 0ef165448399020c809805918906fe6b2563db00 Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:25:53 +0530 Subject: [PATCH 5/8] Add unzip step for artifact deployment in main_subtracker workflow --- .github/workflows/main_subtracker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main_subtracker.yml b/.github/workflows/main_subtracker.yml index cc9cdbb..2bb452a 100644 --- a/.github/workflows/main_subtracker.yml +++ b/.github/workflows/main_subtracker.yml @@ -48,6 +48,9 @@ jobs: uses: actions/download-artifact@v4 with: name: node-app + + - name: Unzip artifact for deployment + run: unzip release.zip -d release - name: 'Deploy to Azure Web App' id: deploy-to-webapp From 19b9f659048c4cef247edcae62d9131425501b91 Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Tue, 17 Dec 2024 06:41:22 +0530 Subject: [PATCH 6/8] Refactor deployment workflow to streamline build process and update artifact paths --- .deployment | 2 ++ .github/workflows/main_subtracker.yml | 20 +++++++------------- 2 files changed, 9 insertions(+), 13 deletions(-) create mode 100644 .deployment diff --git a/.deployment b/.deployment new file mode 100644 index 0000000..6278331 --- /dev/null +++ b/.deployment @@ -0,0 +1,2 @@ +[config] +SCM_DO_BUILD_DURING_DEPLOYMENT=true \ No newline at end of file diff --git a/.github/workflows/main_subtracker.yml b/.github/workflows/main_subtracker.yml index 2bb452a..d18dde5 100644 --- a/.github/workflows/main_subtracker.yml +++ b/.github/workflows/main_subtracker.yml @@ -21,20 +21,17 @@ jobs: 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: Install dependencies + run: npm install - - name: Zip artifact for deployment - run: zip release.zip ./* -r + - name: Build the app + run: npm run build - - name: Upload artifact for deployment job + - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: node-app - path: release.zip + path: dist/ deploy: runs-on: ubuntu-latest @@ -48,14 +45,11 @@ jobs: uses: actions/download-artifact@v4 with: name: node-app - - - name: Unzip artifact for deployment - run: unzip release.zip -d release - name: 'Deploy to Azure Web App' id: deploy-to-webapp uses: azure/webapps-deploy@v3 with: app-name: 'subtracker' - package: release.zip + package: dist/ publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_31F85007BEBA4D3482D09536C58FE53C }} \ No newline at end of file From 70e92efa386eb368c231a97e37d244ce7dd699e6 Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Tue, 17 Dec 2024 06:43:52 +0530 Subject: [PATCH 7/8] Update main_subtracker workflow to standardize quotes and adjust deployment package path --- .github/workflows/main_subtracker.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main_subtracker.yml b/.github/workflows/main_subtracker.yml index d18dde5..3aa7de0 100644 --- a/.github/workflows/main_subtracker.yml +++ b/.github/workflows/main_subtracker.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js version uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: "18.x" - name: Install dependencies run: npm install @@ -37,19 +37,19 @@ jobs: runs-on: ubuntu-latest needs: build environment: - name: 'Production' + name: "Production" url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - + steps: - name: Download artifact from build job uses: actions/download-artifact@v4 with: name: node-app - - - name: 'Deploy to Azure Web App' + + - name: "Deploy to Azure Web App" id: deploy-to-webapp uses: azure/webapps-deploy@v3 with: - app-name: 'subtracker' - package: dist/ - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_31F85007BEBA4D3482D09536C58FE53C }} \ No newline at end of file + app-name: "subtracker" + package: build/ + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_31F85007BEBA4D3482D09536C58FE53C }} From 5cd118a94da0d136e3f078e6a7ef5e255db256b4 Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Tue, 17 Dec 2024 06:53:04 +0530 Subject: [PATCH 8/8] Update main_subtracker workflow to use npm ci for dependency installation and adjust deployment package path --- .github/workflows/main_subtracker.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main_subtracker.yml b/.github/workflows/main_subtracker.yml index 3aa7de0..1925c0a 100644 --- a/.github/workflows/main_subtracker.yml +++ b/.github/workflows/main_subtracker.yml @@ -22,7 +22,7 @@ jobs: node-version: "18.x" - name: Install dependencies - run: npm install + run: npm ci - name: Build the app run: npm run build @@ -45,11 +45,12 @@ jobs: uses: actions/download-artifact@v4 with: name: node-app + path: dist - name: "Deploy to Azure Web App" id: deploy-to-webapp uses: azure/webapps-deploy@v3 with: app-name: "subtracker" - package: build/ + package: dist/ publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_31F85007BEBA4D3482D09536C58FE53C }}