1- # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2- # More GitHub Actions for Azure: https://github.com/Azure/actions
3- # More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions
4-
5- name : Build and deploy Python app to Azure Web App - cbs-tinder-sim
1+ name : Deploy to Heroku
62
73on :
84 push :
95 branches :
10- - main
11- workflow_dispatch :
6+ - main # Change to your default branch if necessary
127
138jobs :
14- build :
15- runs-on : ubuntu-latest
16- permissions :
17- contents : read # This is required for actions/checkout
18-
19- steps :
20- - uses : actions/checkout@v4
21-
22- - name : Set up Python version
23- uses : actions/setup-python@v5
24- with :
25- python-version : ' 3.10'
26-
27- - name : Create and start virtual environment
28- run : |
29- python -m venv venv
30- source venv/bin/activate
31-
32- - name : Install dependencies
33- run : pip install -r requirements.txt
34-
35- # Optional: Add step to run tests here (PyTest, Django test suites, etc.)
36-
37- - name : Zip artifact for deployment
38- run : zip release.zip ./* -r
39-
40- - name : Upload artifact for deployment jobs
41- uses : actions/upload-artifact@v4
42- with :
43- name : python-app
44- path : |
45- release.zip
46- !venv/
47-
489 deploy :
4910 runs-on : ubuntu-latest
50- needs : build
51- environment :
52- name : ' Production'
53- url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
54- permissions :
55- id-token : write # This is required for requesting the JWT
56- contents : read # This is required for actions/checkout
5711
5812 steps :
59- - name : Download artifact from build job
60- uses : actions/download-artifact @v4
61- with :
62- name : python-app
63-
64- - name : Unzip artifact for deployment
65- run : unzip release.zip
66-
67-
68- - name : Login to Azure
69- uses : azure/login@v2
70- with :
71- client-id : ${{ secrets.AZUREAPPSERVICE_CLIENTID_A816710A67CF4714818231D5E8AAE885 }}
72- tenant-id : ${{ secrets.AZUREAPPSERVICE_TENANTID_5F7F434078574781A5D0369CADDF08E2 }}
73- subscription-id : ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_DF5876E227B64A3B829EC5BCA8F3862A }}
74-
75- - name : ' Deploy to Azure Web App '
76- uses : azure/webapps-deploy@v3
77- id : deploy-to-webapp
78- with :
79- app-name : ' cbs-tinder-sim '
80- slot-name : ' Production '
81-
13+ - name : Checkout repository
14+ uses : actions/checkout @v4
15+
16+ - name : Setup Python
17+ uses : actions/setup-python@v4
18+ with :
19+ python-version : ' 3.10 ' # Adjust as needed
20+
21+ - name : Install dependencies
22+ run : |
23+ python -m pip install --upgrade pip
24+ pip install -r requirements.txt
25+
26+ - name : Install Heroku CLI
27+ run : |
28+ curl https://cli-assets.heroku.com/install.sh | sh
29+
30+ - name : Deploy to Heroku
31+ uses : akhileshns/heroku-deploy@v3.12.14
32+ with :
33+ heroku_api_key : ${{ secrets.HEROKU_API_KEY }}
34+ heroku_app_name : " cbs-tinder-sim "
35+ heroku_email : " datingappsim@outlook.com "
0 commit comments