Skip to content

Commit 68aba21

Browse files
Add or update the Azure App Service build and deployment workflow config
1 parent 9dc2578 commit 68aba21

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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 - hirecleo-app
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
workflow_dispatch:
12+
13+
jobs:
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.12'
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+
48+
deploy:
49+
runs-on: ubuntu-latest
50+
needs: build
51+
52+
permissions:
53+
id-token: write #This is required for requesting the JWT
54+
contents: read #This is required for actions/checkout
55+
56+
steps:
57+
- name: Download artifact from build job
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: python-app
61+
62+
- name: Unzip artifact for deployment
63+
run: unzip release.zip
64+
65+
66+
- name: Login to Azure
67+
uses: azure/login@v2
68+
with:
69+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_16FC28EC43414B389F0FF3B12E28CF29 }}
70+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_D991B673E50B4596851EFEA948576901 }}
71+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_1F791673416B408EB86BD77C2CA98071 }}
72+
73+
- name: 'Deploy to Azure Web App'
74+
uses: azure/webapps-deploy@v3
75+
id: deploy-to-webapp
76+
with:
77+
app-name: 'hirecleo-app'
78+
slot-name: 'Production'
79+

0 commit comments

Comments
 (0)