From 4c24d9e3c093e63d6281ff8d4707cd6070d5acc3 Mon Sep 17 00:00:00 2001 From: omwatkins Date: Fri, 25 Apr 2025 17:42:50 -0400 Subject: [PATCH 1/2] Add or update the Azure App Service build and deployment workflow config --- .../workflows/main_atheticbalancesessions.yml | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/main_atheticbalancesessions.yml diff --git a/.github/workflows/main_atheticbalancesessions.yml b/.github/workflows/main_atheticbalancesessions.yml new file mode 100644 index 00000000..b97e5957 --- /dev/null +++ b/.github/workflows/main_atheticbalancesessions.yml @@ -0,0 +1,81 @@ +# 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 - AtheticBalancesessions + +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 + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + 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_F3DDCEE659E5404ABEC617FBF9165B7B }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_6DC04B29A2234AEA89EFFA34F17F0F5C }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_8B02FA23E31945DFAE1FCEE41D3AD17A }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'AtheticBalancesessions' + slot-name: 'Production' + \ No newline at end of file From 41e6910fb45b6d362db33042cd21b988d44afda7 Mon Sep 17 00:00:00 2001 From: omwatkins Date: Fri, 25 Apr 2025 22:55:57 +0000 Subject: [PATCH 2/2] Update VS Code settings for improved development workflow settings.json --- .vscode/settings.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d470da3f..116777c3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,5 +22,10 @@ "**/node_modules": true, "static": true }, - "python.envFile": "" + "python.envFile": "", + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ], + "appService.defaultWebAppToDeploy": "/subscriptions/b0167084-1f27-4824-b52b-67d6568fa14f/resourceGroups/appsvc_linux_eastus2_basic/providers/Microsoft.Web/sites/AtheticBalancesessions", + "appService.deploySubpath": "." } \ No newline at end of file