Skip to content

Commit f13e29e

Browse files
Force add GitHub Actions workflow
1 parent fe29ad8 commit f13e29e

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/azure.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Django to Azure
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
AZURE_WEBAPP_NAME: hirecleo-app # Ditt appnamn i Azure
10+
AZURE_WEBAPP_PACKAGE_PATH: . # Roten av projektet
11+
PYTHON_VERSION: "3.12"
12+
13+
jobs:
14+
build-and-deploy:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: 📥 Check out repo
19+
uses: actions/checkout@v3
20+
21+
- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ env.PYTHON_VERSION }}
25+
26+
- name: 📦 Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
31+
- name: 🔧 Collect static files
32+
run: |
33+
python manage.py collectstatic --noinput
34+
35+
- name: ⚙️ Run migrations
36+
run: |
37+
python manage.py migrate --noinput
38+
39+
- name: 🚀 Deploy to Azure Web App
40+
uses: azure/webapps-deploy@v2
41+
with:
42+
app-name: ${{ env.AZURE_WEBAPP_NAME }}
43+
slot-name: Production
44+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE }}
45+
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

0 commit comments

Comments
 (0)