From 54baeec0e0f1dbeb2dd4207336ed72351187bcf9 Mon Sep 17 00:00:00 2001 From: azufre <32585076+azufre@users.noreply.github.com> Date: Sat, 13 Jul 2024 01:27:56 -0600 Subject: [PATCH 1/2] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_apptestaz900.yml | 78 +++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/main_apptestaz900.yml diff --git a/.github/workflows/main_apptestaz900.yml b/.github/workflows/main_apptestaz900.yml new file mode 100644 index 000000000..ab9c85870 --- /dev/null +++ b/.github/workflows/main_apptestaz900.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 - apptestAZ900 + +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@v5 + with: + python-version: '3.12' + + - 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_93E5A3C1D6AA49EC9B10D6CD666EB813 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_241D254BBF7A4DCCA7B96E00A722BB5E }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_CA80332600904B5CAF7069F4F9AF2E32 }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'apptestAZ900' + slot-name: 'Production' + \ No newline at end of file From c9fd4b5d60b5e55df4e8385a11b2172d4af8b15a Mon Sep 17 00:00:00 2001 From: azufre <32585076+azufre@users.noreply.github.com> Date: Sat, 13 Jul 2024 01:42:20 -0600 Subject: [PATCH 2/2] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_apptestms.yml | 78 ++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/main_apptestms.yml diff --git a/.github/workflows/main_apptestms.yml b/.github/workflows/main_apptestms.yml new file mode 100644 index 000000000..2866f6d85 --- /dev/null +++ b/.github/workflows/main_apptestms.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 - apptestms + +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@v5 + with: + python-version: '3.9' + + - 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_0AC77E767C7144AA8502F41DBD18190C }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D75B7C21EFEE45E89C67E322500052C7 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_786D32759772409F89CE6E575B956D9D }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'apptestms' + slot-name: 'Production' + \ No newline at end of file