From 6624d48296ccb002d7983c4cdf0f4a145acace13 Mon Sep 17 00:00:00 2001 From: tulikac Date: Mon, 9 Jun 2025 10:51:22 +0530 Subject: [PATCH 1/3] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_django-github.yml | 79 ++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/main_django-github.yml diff --git a/.github/workflows/main_django-github.yml b/.github/workflows/main_django-github.yml new file mode 100644 index 00000000..0624fcfe --- /dev/null +++ b/.github/workflows/main_django-github.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 - django-github + +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.13' + + - 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_09E4222B8E4D43D99557E6F201338F7A }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_171A14BDFACF431A8857EF985596E69C }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E56078841F734E84A5F755C18274F510 }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'django-github' + slot-name: 'Production' + \ No newline at end of file From be594c5874783f61d12b1adf2ee3e556f3189b3a Mon Sep 17 00:00:00 2001 From: Tulika Chaudharie Date: Mon, 6 Oct 2025 14:27:47 +0530 Subject: [PATCH 2/3] Updated SKU to B2 --- infra/main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/main.bicep b/infra/main.bicep index 391f0103..9c8956fe 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -74,7 +74,7 @@ module appServicePlan './core/host/appserviceplan.bicep' = { location: location tags: tags sku: { - name: 'B1' + name: 'B2' } } } From 5dc2f063594fe974094de0135b57aa25d56e2930 Mon Sep 17 00:00:00 2001 From: Tulika Chaudharie Date: Mon, 6 Oct 2025 14:30:59 +0530 Subject: [PATCH 3/3] deleted the workflow file --- .github/workflows/main_django-github.yml | 79 ------------------------ 1 file changed, 79 deletions(-) delete mode 100644 .github/workflows/main_django-github.yml diff --git a/.github/workflows/main_django-github.yml b/.github/workflows/main_django-github.yml deleted file mode 100644 index 0624fcfe..00000000 --- a/.github/workflows/main_django-github.yml +++ /dev/null @@ -1,79 +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 -# 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 - django-github - -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.13' - - - 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_09E4222B8E4D43D99557E6F201338F7A }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_171A14BDFACF431A8857EF985596E69C }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E56078841F734E84A5F755C18274F510 }} - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v3 - id: deploy-to-webapp - with: - app-name: 'django-github' - slot-name: 'Production' - \ No newline at end of file