Merge pull request #17 from michaelconan/feature/notion-configs #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy app to Azure | |
# Configures this workflow to run every time a change is pushed to the branch called `main`. | |
on: | |
push: | |
branches: | |
- main | |
env: | |
AZURE_WEBAPP_NAME: airflow-reporting | |
RESOURCE_GROUP: airflow-reporting_group | |
AZURE_WEBAPP_PACKAGE_PATH: '.' | |
STARTUP_COMMAND: 'startup.sh' | |
PYTHON_VERSION: 3.12 | |
# Oryx deploy doesn't recognise constraints | |
CUSTOM_REQUIREMENTSTXT_PATH: './requirements-constraints.txt' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
# Install requirements with constraints | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt -c constraints.txt | |
# Save the installed packages to a file for build | |
pip freeze > ${{ env.CUSTOM_REQUIREMENTSTXT_PATH }} | |
- name: Build web app | |
uses: azure/appservice-build@v3 | |
with: | |
platform: python | |
platform-version: ${{ env.PYTHON_VERSION }} | |
- name: Deploy web app | |
uses: azure/webapps-deploy@v3 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | |
# Not allowed with publish-profile auth | |
# startup-command: ${{ env.STARTUP_COMMAND }} |