Skip to content

Commit ff1dac1

Browse files
authored
Zpi 97/scraping function app (#47)
2 parents 63c1128 + 25ba606 commit ff1dac1

15 files changed

Lines changed: 548 additions & 126 deletions

File tree

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
1-
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2-
# More GitHub Actions for Azure: https://github.com/Azure/actions
3-
# More info on Python, GitHub Actions, and Azure Functions: https://aka.ms/python-webapps-actions
4-
5-
name: Build and deploy Python project to Azure Function App - watchoutMicroservice
6-
7-
on:
8-
push:
9-
branches:
10-
- master
11-
workflow_dispatch:
12-
13-
env:
14-
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
15-
PYTHON_VERSION: '3.13' # set this to the python version to use (supports 3.6, 3.7, 3.8)
16-
17-
jobs:
18-
build:
19-
runs-on: ubuntu-latest
20-
permissions:
21-
contents: read #This is required for actions/checkout
22-
23-
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v4
26-
27-
- name: Setup Python version
28-
uses: actions/setup-python@v5
29-
with:
30-
python-version: ${{ env.PYTHON_VERSION }}
31-
32-
- name: Create and start virtual environment
33-
run: |
34-
python -m venv venv
35-
source venv/bin/activate
36-
37-
- name: Install dependencies
38-
run: pip install -r requirements.txt
39-
40-
# Optional: Add step to run tests here
41-
42-
- name: Zip artifact for deployment
43-
run: zip release.zip ./* -r
44-
45-
- name: Upload artifact for deployment job
46-
uses: actions/upload-artifact@v4
47-
with:
48-
name: python-app
49-
path: |
50-
release.zip
51-
!venv/
52-
53-
deploy:
54-
runs-on: ubuntu-latest
55-
needs: build
56-
57-
steps:
58-
- name: Download artifact from build job
59-
uses: actions/download-artifact@v4
60-
with:
61-
name: python-app
62-
63-
- name: Unzip artifact for deployment
64-
run: |
65-
unzip release.zip
66-
rm release.zip
67-
68-
- name: 'Deploy to Azure Functions'
69-
uses: Azure/functions-action@v1
70-
id: deploy-to-function
71-
with:
72-
app-name: 'watchoutMicroservice'
73-
slot-name: 'Production'
74-
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
# More info on Python, GitHub Actions, and Azure Functions: https://aka.ms/python-webapps-actions
4+
5+
name: Build and deploy Python project to Azure Function App - watchoutMicroservice
6+
7+
on:
8+
push:
9+
branches:
10+
- master
11+
workflow_dispatch:
12+
13+
env:
14+
AZURE_FUNCTIONAPP_PACKAGE_PATH: 'Microservice' # set this to the path to your web app project, defaults to the repository root
15+
PYTHON_VERSION: '3.13' # set this to the python version to use (supports 3.6, 3.7, 3.8)
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read #This is required for actions/checkout
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Python version
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ env.PYTHON_VERSION }}
31+
32+
- name: Create and start virtual environment
33+
run: |
34+
python -m venv venv
35+
source venv/bin/activate
36+
37+
- name: Install dependencies
38+
run: pip install -r requirements.txt
39+
40+
# Optional: Add step to run tests here
41+
42+
- name: Zip artifact for deployment
43+
run: zip release.zip ./* -r
44+
45+
- name: Upload artifact for deployment job
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: python-app
49+
path: |
50+
release.zip
51+
!venv/
52+
53+
deploy:
54+
runs-on: ubuntu-latest
55+
needs: build
56+
57+
steps:
58+
- name: Download artifact from build job
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: python-app
62+
63+
- name: Unzip artifact for deployment
64+
run: |
65+
unzip release.zip
66+
rm release.zip
67+
68+
- name: 'Deploy to Azure Functions'
69+
uses: Azure/functions-action@v1
70+
id: deploy-to-function
71+
with:
72+
app-name: 'watchoutMicroservice'
73+
slot-name: 'Production'
74+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
7575
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_CEC693097F424AC3AB3F824CD8E91B13 }}

‎Microservice/.funcignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git*
2+
.vscode
3+
__azurite_db*__.json
4+
__blobstorage__
5+
__queuestorage__
6+
local.settings.json
7+
test
8+
.venv

‎Microservice/.gitignore‎

Lines changed: 133 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,135 @@
1-
learn
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# IPython
79+
profile_default/
80+
ipython_config.py
81+
82+
# pyenv
83+
.python-version
84+
85+
# pipenv
86+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
87+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
88+
# having no cross-platform support, pipenv may install dependencies that don’t work, or not
89+
# install all needed dependencies.
90+
#Pipfile.lock
91+
92+
# celery beat schedule file
93+
celerybeat-schedule
94+
95+
# SageMath parsed files
96+
*.sage.py
97+
98+
# Environments
99+
.env
2100
.venv
3-
__pycache__
101+
env/
102+
venv/
103+
ENV/
104+
env.bak/
105+
venv.bak/
106+
107+
# Spyder project settings
108+
.spyderproject
109+
.spyproject
110+
111+
# Rope project settings
112+
.ropeproject
113+
114+
# mkdocs documentation
115+
/site
116+
117+
# mypy
118+
.mypy_cache/
119+
.dmypy.json
120+
dmypy.json
121+
122+
# Pyre type checker
123+
.pyre/
124+
125+
# Azure Functions artifacts
126+
bin
127+
obj
128+
appsettings.json
129+
local.settings.json
130+
131+
# Azurite artifacts
132+
__blobstorage__
133+
__queuestorage__
134+
__azurite_db*__.json
4135
.python_packages

‎Microservice/app.py‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎Microservice/commands.txt‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)