From f7235134a7138c94adf9454e322490f3679b758a Mon Sep 17 00:00:00 2001 From: maloygit Date: Tue, 9 Jul 2024 15:31:41 +0530 Subject: [PATCH 1/4] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...atic-web-apps-ambitious-sand-00c864e1e.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml diff --git a/.github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml b/.github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml new file mode 100644 index 000000000..df1c2f264 --- /dev/null +++ b/.github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml @@ -0,0 +1,46 @@ +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: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AMBITIOUS_SAND_00C864E1E }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/" # App source code path + api_location: "" # Api source code path - optional + output_location: "" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + 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_AMBITIOUS_SAND_00C864E1E }} + action: "close" From 1f604f3b3e4e709ce4a57402c29f8d1f9a3690d4 Mon Sep 17 00:00:00 2001 From: maloygit Date: Wed, 10 Jul 2024 15:59:37 +0530 Subject: [PATCH 2/4] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_testmaloy.yml | 67 ++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/main_testmaloy.yml diff --git a/.github/workflows/main_testmaloy.yml b/.github/workflows/main_testmaloy.yml new file mode 100644 index 000000000..614bb10fc --- /dev/null +++ b/.github/workflows/main_testmaloy.yml @@ -0,0 +1,67 @@ +# 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 - testmaloy + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python version + uses: actions/setup-python@v1 + with: + python-version: '3.11' + + - 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@v3 + 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 }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: python-app + + - name: Unzip artifact for deployment + run: unzip release.zip + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + id: deploy-to-webapp + with: + app-name: 'testmaloy' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_02AC5B7098A8471DA7F87360BA4E5B75 }} From 13f5947dd1e2ffc68e49282ab2246ed8e04f3add Mon Sep 17 00:00:00 2001 From: maloygit Date: Wed, 10 Jul 2024 16:13:00 +0530 Subject: [PATCH 3/4] Update azure-static-web-apps-ambitious-sand-00c864e1e.yml --- .../workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml b/.github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml index df1c2f264..f0546c85c 100644 --- a/.github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml +++ b/.github/workflows/azure-static-web-apps-ambitious-sand-00c864e1e.yml @@ -44,3 +44,4 @@ jobs: with: azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AMBITIOUS_SAND_00C864E1E }} action: "close" +skip_app_build: true From 7d3a08a7a4b297b20404eecf8ccc739805f45933 Mon Sep 17 00:00:00 2001 From: Maloy Date: Mon, 3 Mar 2025 21:52:17 +0530 Subject: [PATCH 4/4] file chnaged --- startup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/startup.py b/startup.py index 9fa523781..bf4a94bcc 100644 --- a/startup.py +++ b/startup.py @@ -7,6 +7,7 @@ The solution is to provide a simple alternate startup file, like this present startup.py, that just imports the app object. You can then just specify startup:app in the Gunicorn command. +================================================================== """ from hello_app.webapp import app