Skip to content

Commit

Permalink
Update main_pong42.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hu8813 authored Apr 2, 2024
1 parent 592ab35 commit ed52f5c
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/main_pong42.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# 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 - pong42

on:
Expand All @@ -26,12 +22,11 @@ jobs:
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.)

# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
- name: Zip artifact for deployment
run: |
cd backend
Expand All @@ -42,40 +37,26 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: python-app
path: |
release.zip
!venv/
path: release.zip

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@v3
with:
name: python-app

- name: Unzip artifact for deployment
run: unzip release.zip


- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_6934ADF9CC6B4408B1CDB1A9034C3B3E }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_8D94D3B0C3F144979AFE0D77D4094A81 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_40F0CCB580CD4F328483DEB7AF1933FE }}

- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: 'pong42'
slot-name: 'Production'

publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_1DE85B7374034B939F64D99F5D9310E1 }}
package: ./release.zip # Specify the path to your package

0 comments on commit ed52f5c

Please sign in to comment.