From fd9514ac96430aceb43362fee10d9823053074f1 Mon Sep 17 00:00:00 2001 From: Raghav Somani <77893181+never-code@users.noreply.github.com> Date: Sun, 4 Aug 2024 09:46:35 +0530 Subject: [PATCH 1/3] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_robinhood-tester.yml | 78 +++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/main_robinhood-tester.yml diff --git a/.github/workflows/main_robinhood-tester.yml b/.github/workflows/main_robinhood-tester.yml new file mode 100644 index 000000000..92d6cf843 --- /dev/null +++ b/.github/workflows/main_robinhood-tester.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 - robinhood-tester + +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.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@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_9B1EEF06BC60475591494C35B3D09A92 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_E1AC8243AC08443ABF37E8BDE2DCABCB }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E2F770E4151549E2B259A10A7CD0078C }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'robinhood-tester' + slot-name: 'Production' + \ No newline at end of file From bf59fffc34beeb15d04059fbc189b49095a10819 Mon Sep 17 00:00:00 2001 From: Raghav Somani <77893181+never-code@users.noreply.github.com> Date: Sun, 4 Aug 2024 09:51:30 +0530 Subject: [PATCH 2/3] Remove the Azure App Service build and deployment workflow config --- .github/workflows/main_robinhood-tester.yml | 78 --------------------- 1 file changed, 78 deletions(-) delete mode 100644 .github/workflows/main_robinhood-tester.yml diff --git a/.github/workflows/main_robinhood-tester.yml b/.github/workflows/main_robinhood-tester.yml deleted file mode 100644 index 92d6cf843..000000000 --- a/.github/workflows/main_robinhood-tester.yml +++ /dev/null @@ -1,78 +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 - robinhood-tester - -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.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@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_9B1EEF06BC60475591494C35B3D09A92 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_E1AC8243AC08443ABF37E8BDE2DCABCB }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_E2F770E4151549E2B259A10A7CD0078C }} - - - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v3 - id: deploy-to-webapp - with: - app-name: 'robinhood-tester' - slot-name: 'Production' - \ No newline at end of file From 114742be9b8a347f0a45058d5fde04ac4dec1402 Mon Sep 17 00:00:00 2001 From: Raghav Somani <77893181+never-code@users.noreply.github.com> Date: Sun, 4 Aug 2024 09:52:35 +0530 Subject: [PATCH 3/3] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_robinhood-tester.yml | 78 +++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/main_robinhood-tester.yml diff --git a/.github/workflows/main_robinhood-tester.yml b/.github/workflows/main_robinhood-tester.yml new file mode 100644 index 000000000..f4dcb228d --- /dev/null +++ b/.github/workflows/main_robinhood-tester.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 - robinhood-tester + +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.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@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_3379311FBCAF47CC86FD5ADFB6B86E34 }} + tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_31564FD2D4354DA191134929968F7349 }} + subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_EEF8192FB86049C6B4535C21C48F8B3A }} + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v3 + id: deploy-to-webapp + with: + app-name: 'robinhood-tester' + slot-name: 'Production' + \ No newline at end of file