From 03f9917afe7effa5fa9bff33c7ab5d5cdd050ca9 Mon Sep 17 00:00:00 2001 From: Uzair Ali <134750614+codebyuzair@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:14:42 +0500 Subject: [PATCH 1/6] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/master_ippl-web.yml | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/master_ippl-web.yml diff --git a/.github/workflows/master_ippl-web.yml b/.github/workflows/master_ippl-web.yml new file mode 100644 index 000000000..1212f1fa5 --- /dev/null +++ b/.github/workflows/master_ippl-web.yml @@ -0,0 +1,78 @@ +# 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 - ippl-web + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - 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 + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + 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_20A657D5FBCA41B8AB9B3E6BEB4DF23E }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_426DC48524264C9D8783E2F4EC104188 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6AF9CB28E3FF4138B09D9E7CBC3D5CF7 }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'ippl-web' + slot-name: 'Production' + \ No newline at end of file From 3145755a01f59188659f4706bf04245103820ab6 Mon Sep 17 00:00:00 2001 From: Uzair Ali <134750614+codebyuzair@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:17:54 +0500 Subject: [PATCH 2/6] Update app.py --- app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app.py b/app.py index 7f8a1f2e8..ee718d8a6 100644 --- a/app.py +++ b/app.py @@ -4,3 +4,4 @@ @app.route("/") def hello(): return "Hello, World!" + From 47c2ebc4668b1e0d66208867245e5dd5fbd7d5d4 Mon Sep 17 00:00:00 2001 From: Uzair Ali <134750614+codebyuzair@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:31:05 +0500 Subject: [PATCH 3/6] Add or update the Azure App Service build and deployment workflow config --- .../workflows/master_ippl-web(staging).yml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/master_ippl-web(staging).yml diff --git a/.github/workflows/master_ippl-web(staging).yml b/.github/workflows/master_ippl-web(staging).yml new file mode 100644 index 000000000..be908b6fa --- /dev/null +++ b/.github/workflows/master_ippl-web(staging).yml @@ -0,0 +1,78 @@ +# 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 - ippl-web + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - 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 + environment: + name: 'staging' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + 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_94E9A1B57BF041F3910586F2AFB1655B }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_C6BB5894F5C349B2A1B3142991D4121D }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4F5553B60AD94330A5E5A13660B9C999 }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'ippl-web' + slot-name: 'staging' + \ No newline at end of file From a46642ce19014f8142c76a708cc81aa7778be1c2 Mon Sep 17 00:00:00 2001 From: Uzair Ali <134750614+codebyuzair@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:41:29 +0500 Subject: [PATCH 4/6] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index ee718d8a6..5e3007017 100644 --- a/app.py +++ b/app.py @@ -3,5 +3,5 @@ @app.route("/") def hello(): - return "Hello, World!" + return "Hello, Bitch!" From e28d2a8eb957b18b1460d5ccee75431902a2796d Mon Sep 17 00:00:00 2001 From: Uzair Ali <134750614+codebyuzair@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:47:14 +0500 Subject: [PATCH 5/6] Add or update the Azure App Service build and deployment workflow config --- .../workflows/stagging_ippl-web(staging).yml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/stagging_ippl-web(staging).yml diff --git a/.github/workflows/stagging_ippl-web(staging).yml b/.github/workflows/stagging_ippl-web(staging).yml new file mode 100644 index 000000000..b7171c20f --- /dev/null +++ b/.github/workflows/stagging_ippl-web(staging).yml @@ -0,0 +1,78 @@ +# 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 - ippl-web + +on: + push: + branches: + - stagging + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - 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 + environment: + name: 'staging' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + permissions: + id-token: write #This is required for requesting the JWT + + 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_7B9C1692350F4A7F952684A4C9141210 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_52B2C8E612F14B1C9692C79F981D09B3 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E1F50E25B4FA49DE82199FFA28985F4D }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'ippl-web' + slot-name: 'staging' + \ No newline at end of file From c6553e881d1b7e294e744ebfbdaa08f40b8390e5 Mon Sep 17 00:00:00 2001 From: Uzair Ali <134750614+codebyuzair@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:50:19 +0500 Subject: [PATCH 6/6] Update app.py --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 5e3007017..073ae804d 100644 --- a/app.py +++ b/app.py @@ -3,5 +3,5 @@ @app.route("/") def hello(): - return "Hello, Bitch!" + return "Hello, Azure!"