-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (45 loc) · 1.42 KB
/
azure-container-webapp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: CI Pipeline
on:
push:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Install Dependencies
run: |
pip3 install -r requirements.txt
- name: Run tests with pytest
run: |
pip3 install pytest
- name: Build and push Docker image
run: |
docker build -t ${{secrets.LOGIN_SERVER}}/flask-app:latest .
docker login ${{secrets.LOGIN_SERVER}} -u ${{secrets.AZURE_USERNAME}} -p ${{secrets.AZURE_PASSWORD}}
docker push ${{secrets.LOGIN_SERVER}}/flask-app:latest
deploy-and-get-url:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
run: |
git checkout -b gh-pages
cp -R path/to/deployed/files/* .
git add .
git commit -m "Deploy to GitHub Pages"
git push origin gh-pages
- name: Set Deployment URL as Output
id: set-url
run: echo "::set-output name=url::https://malak-elbanna.github.io/thepantrypuzzle"
get-url:
needs: deploy-and-get-url
runs-on: ubuntu-latest
steps:
- name: Get Deployment URL
run: echo "The deployment URL is ${{ needs.deploy-and-get-url.outputs.url }}"